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

TTreeNode.Index

Ordinal position for the node in its parent node.

Declaration

Source position: comctrls.pp line 3158

public property TTreeNode.Index : Integer
  read GetIndex
  write SetIndex;

Description

Index is an Integer property which contains the ordinal position for the class instance in its Parent node. It also indicates the number of previous siblings (nodes on same level in the Parent node). Index contains -1 if the node does not have an assigned Parent node.

Changing the value for the property causes the tree node to be relocated in the Parent node, or the Owner for top-level nodes. An ETreeViewError exception is raised if the Index for a top-level node is changed and Owner has not been assigned. The MoveTo method is called to relocate the tree node to the new position in the property value.

Use AbsoluteIndex to get the position for a node including all of the preceding sibling nodes and their children.

Errors

ETreeViewError
Raised if the Index for a top-level node is changed and Owner has not been assigned.

See also

TTreeNode.Parent

  

Parent node for the current tree node.

TTreeNode.Owner

  

Owner of the tree node instance.

TTreeNode.MoveTo

  

Relocates a node to the specified Destination node using the specified mode of attachment.

TTreeNode.Level

  

The number of ancestor nodes for the current tree node.

TTreeNode.AbsoluteIndex

  

The absolute ordinal position for the node, regardless of its level or ancestry, in the tree node hierarchy.

TTreeNodes.TopLvlItems

  

Provides indexed access to tree nodes at the top level of the tree structure.

ETreeViewError

  

Exception type raised for errors in a tree view.


Version 4.0 Generated 2025-05-03 Home