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

# TCustomListView.DrawItem

Draws the specified list item with a given state.

## Declaration

Source position: comctrls.pp line 1556

`protected procedure TCustomListView.DrawItem(`
`AItem: TListItem;`
`ARect: TRect;`
`AState: TOwnerDrawState`
`);`

## Arguments

`AItem` |  | List view item drawn in the method.
`ARect` |  | TRect instance with the bounds for the list item.
`AState` |  | Drawing state applied to the list item in the OnDrawItem event handler. Ignored when default drawing is performed for the list item.

## Description

Signals the OnDrawItem event handler (when assigned) to draw the list item. Calls the FillRect and TextOut methods in the control Canvas if the event handler has not been assigned.

DrawItem is called when a CN_DRAWITEM message us received and handled for the control.

## See also

TCustomListView.OnDrawItem |  | Event handler signalled to render an owner drawn item.
TCustomListView.Canvas |  | TCanvas instance used to draw the control.
TCanvas.FillRect |  | Fills a rectangular area on the canvas using the current Brush settings.
TCanvas.TextOut |  | Writes text at the specified position on the canvas.
TOwnerDrawState |  | Set type used for TOwnerDrawStateType values.