[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'ComCtrls' (#lcl)

TCustomTreeView.Items

The container with the TTreeNode instances for the control.

Declaration

Source position: comctrls.pp line 3750

public property TCustomTreeView.Items : TTreeNodes
  read FTreeNodes
  write SetTreeNodes;

Description

Items is a TTreeNodes property with the container used to access and maintain the hierarchical list of TTreeNode instances displayed on the tree view control.

Items allows indexed access to the TTreeNode instances in the container by their ordinal position.

// the following are equivalent
AText := ATreeView.Items[0].Text;  // caption for the first tree node
AText := ATreeView.Items.Item[0].Text;  // caption for the first tree node

The nodes in Items can be added at design-time using the Object Inspector, or at run-time. Methods in Items can be used to access and maintain the tree nodes and their hierarchy, including:

See TTreeNodes for more information about the properties and methods in the container class.

Use the Select, ClearSelect and ClearSelection methods to maintain the selected node(s) on the tree view control. Use MultiSelect to enable or disable multiple tree node selection on the control.

Use Selected, Selections, and SelectionCount to access single- or multi-selected nodes on the tree view control.

See also

TTreeNodes

  

Implements a container for TTreeNode instances.

TTreeNode

  

Implements a tree node displayed in a TTreeView control.


Version 3.2 Generated 2024-02-25 Home