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

# TTreeNode.DisplayTextRight

Returns the horizontal position for the right edge of the Text on the tree node.

## Declaration

Source position: comctrls.pp line 3104

`public function TTreeNode.DisplayTextRight: Integer;`

## Function result

Horizontal coordinate where the Text for the tree node ends.

## Description

DisplayTextRight is a method used to determine the horizontal coordinate for the right-hand edge of the Text displayed for the tree node. If a TCustomTreeview instance has not been assigned in the tree node, the return value contains the result from the DisplayTextLeft method. Otherwise, the position is calculated using the left-hand edge for the Text, the width returned from the TextWidth method in the control Canvas, and padding derived from the Indent used on the TreeView control.

DisplayTextRight is used in the DisplayRect method in TTreeNode. It is also used in TCustomTreeView methods including GetNodeAt, GetNodeWithExpandSignAt, GetHitTestInfoAt, and MouseDown.

## See also

TTreeNode.Text |  | Text displayed for the tree node.
TTreeNode.TreeView |  | The tree view control where the node is displayed.
TTreeNode.DisplayTextLeft |  | Returns the position for the left edge of the text on the tree node.
TTreeNode.DisplayRect |  | Returns the rectangle where the tree node is displayed on its TreeView control.
TCustomTreeView.Indent |  | Number of pixels used to indent branch levels (child nodes) on the tree view control.
TCustomTreeView.GetNodeAt |  | Searches all expanded nodes for the tree node at the specified position.
TCustomTreeView.GetNodeWithExpandSignAt |  | Gets the tree node at the specified coordinates which has a visible expand indicator, or Nil.
TCustomTreeView.GetHitTestInfoAt |  | Returns hit test results for the specified coordinates.
TCustomTreeView.MouseDown |  | Handles mouse down events for the tree view control.
TCustomControl.Canvas |  | The drawing surface for the control.
TCanvas.TextWidth |  | Gets the width for the specified text using the canvas Font.