Show: Delphi C++
Display Preferences

API:Vcl.ComCtrls.TTreeView.Items

From XE3 API Documentation
Jump to: navigation, search

Delphi

property Items;

C++

__property Items;

Properties

Type Visibility Source Unit Parent
property published
Vcl.ComCtrls.pas
Vcl.ComCtrls.hpp
Vcl.ComCtrls TTreeView

Description

Lists the individual nodes that appear in the tree view control.

Vcl.ComCtrls.TTreeView.Items inherits from Vcl.ComCtrls.TCustomTreeView.Items. All content below this line refers to Vcl.ComCtrls.TCustomTreeView.Items.

Lists the individual nodes that appear in the tree view control.

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 := TreeView1.Items[1];



MyTreeNode = TreeView1->Items[1];



When setting this property at design-time in the Object Inspector the Tree View 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.

Note: 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.

See Also

Personal tools
Translations