Vcl.StdCtrls.TCustomListBox.OnDrawItem
Delphi
property OnDrawItem: TDrawItemEvent read FOnDrawItem write FOnDrawItem;
C++
__property TDrawItemEvent OnDrawItem = {read=FOnDrawItem, write=FOnDrawItem};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
event | protected | Vcl.StdCtrls.pas Vcl.StdCtrls.hpp |
Vcl.StdCtrls | TCustomListBox |
Description
Occurs when an item in an owner-draw list box needs to be redisplayed.
Use OnDrawItem to write a handler for drawing of the items in list boxes with the 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.
The size of the rectangle that contains the item is determined either by the ItemHeight property for fixed owner-draw list boxes or by the response to the OnMeasureItem event for variable owner-draw list boxes.
OnDrawItem is an event handler of type Vcl.StdCtrls.TDrawItemEvent.
See Also
Code Examples