Sign in Join
FPDoc Onlineexperiment

TCustomListBox.OnMeasureItem property

Member of TCustomListBoxpublicIn 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 specified item in the list box control. OnMeasureItem is signalled (when assigned) from the MeasureItem method, and occurs when the LM_MeasureItem message is handled for the control. MeasureItem provides the arguments passed to the event handler, while the message handler stores the calculated height in ItemHeight when it is not 0 (zero).

An application must implement an object procedure to respond to the event notification. Index contains the position in Items with the string to examine in the event handler. On entry, TheHeight contains the text height for the current Font calculated using the Canvas in the control. The value in TheHeight can be updated with the value derived in the event handler.

See also

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