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

# TTreeNode.GetFirstSibling

Gets the first tree node at the same level in the tree.

## Declaration

Source position: comctrls.pp line 3108

`public function TTreeNode.GetFirstSibling: TTreeNode;`

## Function result

First tree node at the same level.

## Description

GetFirstSibling is a TTreeNode function which returns the first tree node at the same Level in the tree node hierarchy. The return value may be the same as the current class instance when it is the first (or only) node at the current Level.

When a Parent node has been assigned, its GetFirstChild method is used to get the return value. Otherwise, the internal linked list for the subtree is used to get the previous tree node as the return value.

## See also

TTreeNode.Level |  | The number of ancestor nodes for the current tree node.
TTreeNode.Parent |  | Parent node for the current tree node.
TTreeNode.GetFirstChild |  | Gets the first child node in the Items property.