Sign in Join
FPDoc Onlineexperiment

TCustomComboBox.OnMeasureItem property

Member of TCustomComboBoxprotectedIn unit StdCtrls

Handler invoked when the height for an item is needed.

Declaration

pascal
property OnMeasureItem: TMeasureItemEvent read FOnMeasureItem write FOnMeasureItem;

Description

OnMeasureItem is a TMeasureItemEvent property with the event handler signalled to get the height for an item displayed in the list box for the control.

OnMeasureItem is signalled (when assigned) from the MeasureItem method. MeasureItem (and OnMeasureItem) are used when the Style property indicates that the control uses a variable height for each item displayed in the list box. OnMeasureItem occurs when the LM_MeasureItem message is handled for the control.

Use the Index argument to get the value in Items examined in the event handler. Use ItemWidth to determine the maximum width allowed for the variable height item. Canvas can be used to get text metrics for the Font used in the control. Update the AHeight argument with the height calculated for the item.

Use ItemHeight for the item height used for fixed height drawing styles.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.