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

# TTreeNode.DisplayRect

Returns the rectangle where the tree node is displayed on its TreeView control.

## Declaration

Source position: comctrls.pp line 3101

`public function TTreeNode.DisplayRect(`
`TextOnly: Boolean`
`):TRect;`

## Arguments

`TextOnly` |  | Set to True if the rectangle should contain the display area for its Text only.

## Function result

TRect instance where the tree node is displayed on its tree view control.

## Description

DisplayRect returns the coordinates for rectangle containing the content for the tree node. The Left, Top, Right, and Bottom members in the return value are adjusted for the BorderWidth used on the TreeView control for the node.

When TextOnly is set to True, the return value contains the coordinates where the text for the node is located on the TreeView control. The Left and Right members in the rectangle are set to the values returned from the DisplayTextLeft and DisplayTextRight methods.

The return value contains an empty rectangle (with all members set to 0) if TreeView has not been assigned for the node.

DisplayRect is called from methods that include:

- TCustomTreeview.DoPaintNode
- TCustomTreeview.GetInsertMarkAt

## See also

TTreeNode.TreeView |  | The tree view control where the node is displayed.
TCustomTreeView.DoPaintNode |  | Renders the specified tree node to the canvas for the control.
TCustomTreeView.GetInsertMarkAt |  | Determines if there is an insert mark at the specified coordinates.
TRect