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

# TCustomTreeView.OnCustomDrawItem

Event handler signalled to custom draw an item (tree node) on the control.

## Declaration

Source position: comctrls.pp line 3677

`protected property TCustomTreeView.OnCustomDrawItem : TTVCustomDrawItemEvent read FOnCustomDrawItem write FOnCustomDrawItem;`

## Description

OnCustomDrawItem is a TTVCustomDrawItemEvent property with the event handler signalled to custom-draw the tree nodes displayed on the tree view control. OnCustomDrawItem is signalled from the CustomDrawItem method, and occurs during processing performed in the PaintNode method for the control.

Arguments to the event handler include:

Sender
  The tree view control for the event notification.
Node
  The TTreeNode instance with the node custom-drawn in the handler routine.
State
  TCustomDrawState value with the drawing state for the tree node.
DefaultDraw
  Variable Boolean argument used to indicate whether the PaintNode process can continue. Set to False in the handler routine to halt further paint operations for the tree node.

If either OnCustomDrawItem or OnAdvancedCustomDrawItem are assigned, the IsCustomDrawn method returns True.

## See also

TCustomTreeView.CustomDrawItem |  | Performs custom drawing for a tree node using the event handlers in the control.
TCustomTreeView.OnAdvancedCustomDrawItem |  | OnAdvancedCustomDrawItem - event handler for advanced custom drawing item.
TCustomTreeView.IsCustomDrawn |  | Returns True if the specified target is custom-drawn.
TCustomTreeView.DoPaintNode |  | Renders the specified tree node to the canvas for the control.
TCustomTreeView.DoPaint |  | Implements the Paint method for the control.
TCustomTreeView.Paint |  | Renders the tree view control.
TTreeNode |  | Implements a tree node displayed in a TTreeView control.
TTVCustomDrawItemEvent |  | TTVCustomDrawItemEvent - generic event handling method for Tree View Item custom drawing.