Sign in Join
FPDoc Onlineexperiment

TCustomComboBox.DrawItem procedure

Member of TCustomComboBoxprotectedIn unit StdCtrls

Draws a list item, using the OnDrawItem handler (when assigned).

Declaration

pascal
procedure DrawItem(Index: Integer; ARect: TRect; State: TOwnerDrawState)
 ; virtual

Arguments

Index

The position for the item drawn in the method.

ARect

The area to paint on the Canvas.

State

The drawing state for the item (selected...).

Description

DrawItem is a procedure used to draw a list item defined in the Items property. DrawItem is called when the LM_DrawListItem message is handled for the control. Arguments passed to the method include the position in Items for the value drawn, the canvas rectangle where the drawing occurs, and the drawing state for the list item.

DrawItem signals the OnDrawItem handler (when assigned) to perform the drawing operation. Otherwise, default painting is performed by filling the background for the Canvas rectangle (if needed) and calling the InternalDrawItem routine.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.