[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'StdCtrls' (#lcl)

TCustomComboBox.MeasureItem

Gets the height for an item in the drop-down list.

Declaration

Source position: stdctrls.pp line 353

protected procedure TCustomComboBox.MeasureItem(

  Index: Integer;

  var TheHeight: Integer

); virtual;

Arguments

Index

  

The index of the item whose height is required.

TheHeight

  

The height of the item, in pixels, calculated in the OnMeasureItem handler.

Description

MeasureItem is a procedure used to get the height for an item in the drop-down list for the control.

MeasureItem is called when the LM_MeasureItem message is handled for the control. The value in ItemHeight has already been updated in the message handler, and is used for a list box Style that has a fixed item height. MeasureItem is called from the message handler when the Style uses a variable item height. The derived item height is stored in the ItemHeight property when it is a non-zero positive value.

MeasureItem signals the OnMeasureItem event handler (when assigned) to calculate the height for the specified item. The value in the Index argument determines the string value in Items used for the calculation. TheHeight is updated with the derived height for the list box item. An application must implement the OnMeasureItem event handler to calculate the height for variable height items in the control.

See also

TCustomComboBox.OnMeasureItem

  

Handler invoked when the height for an item is needed.

TCustomComboBox.ItemWidth

  

The minimum width of the items in the drop-down list.

TCustomComboBox.ItemHeight

  

The default height of an item in the drop-down for the control.

TCustomComboBox.Style

  

Controls the appearance and behavior for the combo-box.

TLMMeasureItem

  


Version 3.2 Generated 2024-02-25 Home