Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

Expanding/Collapsing Items

SftTree/DLL 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 parent items with dependent items.

Under program control, an application responds to SFTTREEN_LBUTTON-type notifications and expands and collapses items using Collapse, Expand or SetItemExpand. The current expand/collapse status of an item can be retrieved using GetItemExpand.

An application can also fully control expanding and collapsing tree items. Rather than adding all items initially, including dependent items (child items), an application can add all parent items and mark them as expandable without actually adding the dependent items (see SetItemExpandable). Then, once the application receives a SFTTREEN_LBUTTON-type notification, signaling that the user wants to expand a parent item, the application can insert the dependent items.