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

TCustomColorListBox.DrawItem

Draws the color preview and name for an item in list box control.

Declaration

Source position: colorbox.pas line 195

protected procedure TCustomColorListBox.DrawItem(

  Index: Integer;

  Rect: TRect;

  State: TOwnerDrawState

); override;

Description

DrawItem is an overridden method used to custom draw an item in the control.

A color preview is drawn using the value in Colors. For clNone and clDefault, the value in NoneColorColor and DefaultColorColor are used to draw the color preview. The value in State is updated to include odBackgroundPainted in the state flags.

The item rectangle is made smaller and passed to the inherited method to draw the text for the item.

The Brush color and Pen color for the control Canvas are reset to their original values after drawing the item.

See also

TCustomListBox.DrawItem

  

Paints an item in owner-draw mode.


Version 4.0 Generated 2025-05-03 Home