Type: Boolean array
Availability: Read or write at run time only
The itemExpanded property enables the expansion (or collapse) status of each item in a ListBox control or a ComboBox control to be obtained or set.
The itemExpanded property contains a reference to an array of
Expanding an item that is not visible automatically expands all of the parents of the entry so that it becomes visible.
The itemExpanded property of an entry without subitems is always set to false. Setting the itemExpanded property for such an entry has no effect. If the specified item has subitems, the itemExpanded property returns whether the item has been expanded or is currently collapsed.
Setting this property to true results in the expansion of the subitems (if they are not already expanded). Setting this property to false results in the hiding of all subitems (if they are not already collapsed).
The code fragments in the following examples show the use of the itemExpanded property.
while count < listOrg.listCount do listOrg.itemExpanded [count] := true; count := count + 1; endwhile; if listbox.itemExpanded[picIndex] then // Remove all of the Retail Sale Items for this Category. childIndex := listbox.findStringExact(picIndex, $ItemsForSale); if listbox.itemExpanded[childIndex] then zRemoveItemsFromList(childIndex); endif; // Remove all of the Tender Sale Items for this Category. childIndex := listbox.findStringExact(picIndex, $ItemsForTender); if listbox.itemExpanded[childIndex] then zRemoveItemsFromList(childIndex); endif; endif;
Entries are not automatically expanded or collapsed. You have control over this process. In most cases, you need to add the following logic to the pictureClick method.
list1.itemExpanded[picIndex] := not list1.itemExpanded[picIndex];
In this example, the picIndex value is the parameter that is passed to this method.