Vcl.StdCtrls.TCustomComboBox.DrawItem

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure DrawItem(Index: Integer; Rect: TRect;  State: TOwnerDrawState); virtual;

C++

virtual void __fastcall DrawItem(int Index, const System::Types::TRect &Rect, Winapi::Windows::TOwnerDrawState State);

Properties

Type Visibility Source Unit Parent
procedure
function
protected
Vcl.StdCtrls.pas
Vcl.StdCtrls.hpp
Vcl.StdCtrls TCustomComboBox

Description

Generates an OnDrawItem event.

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.

See Also