RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDriveComboBox.DrawItem Method

Generates an OnDrawItem event.

Pascal
procedure DrawItem(Index: Integer; Rect: TRect; State: TOwnerDrawState); override;
C++
virtual __fastcall DrawItem(int Index, TRect Rect, TOwnerDrawState State);

When Style is csOwnerDrawFixed or csOwnerDrawVariable, DrawItem is called whenever an item in the list needs to be drawn. If an OnDrawItem event handler is assigned, DrawItem generates an OnDrawItem event, passing the Index, Rect, and State parameters to the event handler. Otherwise, OnDrawItem fills the rectangle passed in Rect and draws any text associated with the indexed item, ignoring the State parameter. 

Override DrawItem to provide class-specific drawing code for the items in the list. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!