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

# TCustomListView.CustomDraw

Performs custom drawing in the specified rectangle and returns True on success.

## Declaration

Source position: comctrls.pp line 1552

`protected function TCustomListView.CustomDraw(`
`const ARect: TRect;`
`AStage: TCustomDrawStage`
`):Boolean; virtual;`

## Arguments

`ARect` |  | Bounds rectangle for the drawing operation.
`AStage` |  | Drawing stage for the control. Affects the OnCustomDraw event handler.

## Function result

True if default drawing should be performed in the list view control. False is default drawing was handled in an event handler and can be skipped by the control.

## Description

CustomDraw draws the list view control using the OnCustomDraw or OnAdvancedCustomDraw event handlers. OnCustomDraw is signalled (when assigned) if the drawing stage in AStage is cdPrePaint. OnAdvancedCustomDraw is signalled (when assigned).

The default return value is True, but may be modified in the event handlers if it is not able to render the control in the handler routine.

Use OnDrawItem and OnAdvancedCustomDrawItem to draw an individual list item on the control.

CustomDraw is called from the IntfCustomDraw method and occurs when the widgetset class instance redraws the LCL control.

## See also

TCustomListView.OnCustomDraw |  | Event handler signalled to perform custom drawing for the list view control.
TCustomListView.OnCustomDrawItem |  | Event handler signalled to perform custom drawing for list items on the control.
TCustomListView.OnAdvancedCustomDraw |  | Event handler signalled to custom draw the grid control when the draw state is not cdPrePaint.
TCustomListView.OnAdvancedCustomDrawItem |  | Event handler signalled to custom draw a list item on the grid control when the draw state is not cdPrePaint.
TCustomListView.IntfCustomDraw |  | IntfCustomDraw - uses the interface to perform custom drawing