treecombobox Items property
Return to Introduction  Previous page  Next page
Applies to
acTreeComboBox component.  

property Items: TTreeNodes;  

The Items property lists the individual nodes that appear in the TreeView control, embedded to the drop-down window of acTreeComboBox.  
Individual nodes in a tree view are TTreeNode objects. These individual nodes can be accessed by using the Items property along with the item's index into the tree view. For example, to access the second item in the tree view, you could use the following code.  
MyTreeNode := acTreeComboBox1.Items[1];  
When setting this property at design-time in the Object Inspector the TreeView Items Editor appears. Use the New Item and New SubItem buttons to add items to the tree view. Use the Text property to modify what text is displayed in the label of the item.  
At run-time nodes can be added and inserted by using the TTreeNodes methods AddChildFirst, AddChild, AddChildObjectFirst, AddChildObject, AddFirst, Add, AddObjectFirst, AddObject and Insert.  

Accessing tree view items by index can be time-intensive, particularly when the tree view contains many items. For optimal performance, try to design your application so that it has as few dependencies on the tree view's item index as possible;  
tip Alternatively you can access the tree nodes at run-time through TreeView property.  

See also
TreeView, TreeOptions and SelectedNode properties.