TcxCustomComboBoxProperties.OnMeasureItem Event
Occurs each time a combo box item should be repainted.
Declaration
property OnMeasureItem: TMeasureItemEvent read; write;
Remarks
Handle this event when you need to change the default height of individual items in the combo box and MRU editors. The default height is determined by the ItemHeight property and is passed in AHeight
. To change the default height, set a new value to the AHeight
parameter.
The currently processed item is identified by the AIndex
parameter. This represents the index of the item in the Items list. The editor itself is passed as the AControl
parameter.
ACanvas
specifies the canvas for drawing an item. You can use members of the ACanvas
object, for instance, to determine the height of the sample text drawn on this canvas using a particular font.
The OnMeasureItem
event can be useful when you perform custom draw of items via the OnDrawItem event. In this case, handle the OnMeasureItem
event to allocate sufficient space for your item. Then draw the item by handling the OnDrawItem event.