treecombobox TacTreeComboBox component
Hierarchy Properties Methods Events Controls with attached label
Return to Introduction  Previous page  Next page
The TreeComboBox is the combo-box with the TreeView embedded to its drop-down window. So, instead of searching and selecting the necessary list item from huge list of drop-down window, user will be able to see an elegant tree-like structure, select the tree nodes, expand and collapse them, export and import the nodes to another TreeView controls and so on.  
Like in standard TreeView, the TreeComboBox can display images for each tree node, show image in editor, accept the selection either on one or double click, contains the label attached to control, customizeable image for button + many other neat features, result of combination of ComboBox and TreeView.  


How to use?
Drop acTreeComboBox control onto your form and specify the tree nodes to Items property + if the list items should contain an icons — specify the image list to Images property. In general, the TreeComboBox are ready for work… But let's change some its behaviours… For example we want the tree nodes to be selected by double click intead of one, and don't like that selection hovers the nodes under mouse. Then just set AcceptOnDblClick property to True (the nodes will be selected on double click), and set TreeOptions.MouseTrack property to False (mouse will not track the selection in drop-down view).  
To change the selected node at run- or design-time — modify ItemIndex property (this is the absolute index of selected node).  
To change the width and height of the drop-down window — set DropDownCount and DropDownWidth properties. To let user to enter or modify the text using keyboard — set ShowEditor property to True.  
The EmptyItemText and EmptyItemImageIndex properties can be used to specify the text and image which should be displayed in the box when no tree node currently selected.  
To take some specific actions when the drop-down window appears or disappears — write OnDropDown, OnAfterDropDown and OnCloseUp event handlers.  
Also the tree nodes of TreeComboBox can be exported or imported from another containers of TTreeNodes object, like standard TreeView control. Check out ExportToTreeNodes and ImportFromTreeNodes methods for more details.  

See also
acEdit and acTreeView components.