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

# TDrawItemEvent

Specifies an event handler used to paint a single item in an owner-drawn list box or combo-box.

## Declaration

Source position: stdctrls.pp line 282

`type TDrawItemEvent = procedure(`
`Control: TWinControl;`
`Index: Integer;`
`ARect: TRect;`
`State: TOwnerDrawState`
`) of object;`

## Arguments

`Control` |  | The control for the owner-drawn operation.
`Index` |  | Index of the list item to draw.
`ARect` |  | The Canvas rectangle for the list item.
`State` |  | Flags describing the drawing state for the list item.

## Description

TDrawItemEvent is an object procedure type which specifies an event handler signalled to paint an single item in a owner-drawn list box or combo-box control. Arguments passed to the event handler identify the control, the index for the list item, the canvas coordinates, and the drawing state for the operation. The event handler is responsible for rendering the list item to its control in its entirety when the control uses owner-drawn style settings.

TDrawItemEvent is the type used to implement the OnDrawItem property in TCustomComboBox and TCustomListBox. An application must implement and assign an object procedure using the signature for the handler to respond to the event notification.

## See also

TCustomComboBox.OnDrawItem |  | Handler for special painting of an item (in owner-draw mode).
TCustomListBox.OnDrawItem |  | Handler for painting of a list item in owner-draw mode.