Vcl.StdCtrls.TDrawItemEvent
C++
typedef void __fastcall (__closure *TDrawItemEvent)(Vcl::Controls::TWinControl* Control, int Index, const System::Types::TRect &Rect, Winapi::Windows::TOwnerDrawState State);
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
typedef | public | Vcl.StdCtrls.hpp | Vcl.StdCtrls | Vcl.StdCtrls |
Description
TDrawItemEvent is the type of the Vcl.StdCtrls.TCustomListBox.OnDrawItem, the Vcl.StdCtrls.TCustomComboBox.OnDrawItem and the Vcl.Outline.TCustomOutline.OnDrawItem event handlers.
TDrawItemEvent defines the type of method procedure that you must define in order to implement the OnDrawItem event of a visual component such as TListBox.
OnDrawItem is used to write a handler for drawing of the items in list boxes with the TListBoxStyle style values lbOwnerDrawFixed
, lbOwnerDrawVariable
, or lbVirtualOwnerDraw
. OnDrawItem occurs when the list box needs to display an item. OnDrawItem occurs only for owner-draw list boxes.
Control |
is a reference to the component invoking the OnDrawEvent. |
Index |
is the index of the item in the list box. |
Rect |
defines the rectangle in which the user drawing must be made. |
State |
defines state of the item to be drawn. |