Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxCustomComboBoxProperties.OnMeasureItem Event

In This Article

Occurs each time a combo box item should be repainted.

#Declaration

Delphi
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.

See Also