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

# TTreeNode.GetPrevVisible

Returns the previous visible (not hidden) tree node in the node hierarchy.

## Declaration

Source position: comctrls.pp line 3129

`public function TTreeNode.GetPrevVisible(`
`aEnabledOnly: Boolean = False`
`):TTreeNode;`

## Arguments

`aEnabledOnly` |  | True if the previous node must also be Enabled. False if Enabled is not examined in the method.

## Function result

Next tree node in the node hierarchy with the requires states, or Nil when a node is not found with the required states.

## Description

GetPrevVisible is a TTreeNode method used to get the next tree node in the node hierarchy with the node states required in the method. The tree node in the return value must have its Expanded and Visible properties enabled. The AEnabledOnly argument indicates whether the node must also have its Enabled property set to True. When AEnabledOnly is set to False, the Enabled property for the node is not examined in the method.

GetPrevVisible calls GetPrevVisibleSibling to locate a previous sibling node with the required states. When found, its GetLastVisibleChild method is called to get the return value. When not found, the Parent node is searched for a child node with the required states.

The return value is Nil if a previous tree node with the required states is not found.

## Version info

Modified in LCL version 3.0. Refactored to include the AEnabledOnly argument.