RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
StdCtrls.TDrawItemEvent Type

TDrawItemEvent is the type of an OnDrawItem event handler.

Pascal
TDrawItemEvent = procedure (Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState) of object;
C++
(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState) ( TDrawItemEvent)();

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.  

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!