Vcl.ExtCtrls.TCustomColorBox.DrawItem
Delphi
procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); override;
C++
virtual void __fastcall DrawItem(int Index, const System::Types::TRect &Rect, Winapi::Windows::TOwnerDrawState State);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
protected | Vcl.ExtCtrls.pas Vcl.ExtCtrls.hpp |
Vcl.ExtCtrls | TCustomColorBox |
Description
Renders an individual item in the color box.
Applications can't call this protected method. It is called automatically when the color box needs to paint one of the items in the list. DrawItem draws a small box that displays the color that the item represents, followed by the name of the color.
Index is the index of the item to draw, where 0 specifies the first item, 1 specifies the second item, and so on.
Rect indicates the boundaries of the item on the color box's canvas, in client coordinates.
State indicates state information that can affect the way the item is drawn. In TCustomColorBox, DrawItem uses State to determine whether an item is selected, but ignores all other state information.