Vcl.StdCtrls.TComboBox.OnDrawItem
Delphi
property OnDrawItem;
C++
__property OnDrawItem;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
event | published | Vcl.StdCtrls.pas Vcl.StdCtrls.hpp |
Vcl.StdCtrls | TComboBox |
Description
Occurs when an item in an owner-draw combo box needs to be displayed.
Vcl.StdCtrls.TComboBox.OnDrawItem inherits from Vcl.StdCtrls.TCustomComboBox.OnDrawItem. All content below this line refers to Vcl.StdCtrls.TCustomComboBox.OnDrawItem.
Occurs when an item in an owner-draw combo box needs to be displayed.
Write an OnDrawItem event handler to draw the items in the drop-down list of an owner-draw combo box. An OnDrawItem event handler can add graphic elements to the list items, or replace the list item text by graphics.
Draw the items on the Canvas using the coordinates provided by the Rect parameter. OnDrawItem occurs only if Style is set to csOwnerDrawFixed or csOwnerDrawVariable.
If an OnDrawItem event handler is not provided, the combo box fills the Rect parameter with the current brush and writes the text value of the item specified by the Index parameter.
OnDrawItem is an event handler of type Vcl.StdCtrls.TDrawItemEvent.