SftTree/OCX supports expanding and collapsing tree items with minimal application intervention. Items in a tree control are managed as a linear list, or array, of items. The application can expand and collapse items without having to add or remove items. The tree control takes care of hiding and making items visible as needed. The expand/collapse buttons are automatically displayed as needed for with items.
The AutoRespond property allows the tree control to expand and collapse items automatically or under program control. Under program control, an application can respond to ItemClick and ItemDblClick events and expand or collapse items using the Item.Expanded property or the Item.Expand and Item.Collapse methods.
An application can also fully control expanding and collapsing tree items. Rather than adding all items, including items (child items), an application can add all and mark them as expandable without actually adding the items (see the Item.Expandable property). Then, once the application receives an ItemClick event, signaling that the user wants to expand a , the application can add the items.
When items are expanded or collapsed, the ItemExpanded or ItemCollapsed events occur.