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

# TTreeNodes.FindTopLvlNode

Gets a top-level node containing the specified text.

## Declaration

Source position: comctrls.pp line 3265

`public function TTreeNodes.FindTopLvlNode(`
`const NodeText: string`
`):TTreeNode;`

## Arguments

`NodeText` |  | Text to locate in the top-level siblings.

## Function result

Tree node with the specified text, or Nil.

## Description

FindTopLvlNode is a method used to retrieve a tree node which is one of the child nodes at the top level of the tree. It calls GetFirstNode to find the first TTreeNode instance at the root level in the tree. The tree node and each of its sibling nodes are checked until a node with the text specified in NodeText is found.

When the CaseInsensitiveFilenames compiler define is enabled, the SameText routine in SysUtils is called to perform a case-insensitive comparison using the text in the node and the value in NodeText. Otherwise, case is significant in the comparisons.

The return value is the TTreeNode instance where the Text property matches the value in NodeText, or Nil when a node with a matching value is not found.

FindTopLvlNode is used in the implementation of the FindNodeWithTextPath method.