Vcl.StdCtrls.TCustomComboBox.OnDrawItem

From RAD Studio API Documentation
Jump to: navigation, search

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 TCustomComboBox

Description

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.

See Also