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

# TTreeNode.IndexOf

Get the index position for the specified child tree node.

## Declaration

Source position: comctrls.pp line 3132

`public function TTreeNode.IndexOf(`
`AValue: TTreeNode`
`):Integer;`

## Arguments

`AValue` |  | Child node to locate in Items.

## Function result

Ordinal position for the specified child node, or -1 when not a child node.

## Description

The return value is -1 if the tree node in AValue is not a child node (its Parent node is not the current class instance). Calls GetIndex to calculate the position of the child node relative to previous sibling nodes. Roughly equivalent to calling IndexOf in the Items container, but using a TTreeNode search value instead of a String.