Vcl.StdCtrls.TCustomListBox.MeasureItem

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure MeasureItem(Index: Integer; var Height: Integer); virtual;

C++

virtual void __fastcall MeasureItem(int Index, int &Height);

Properties

Type Visibility Source Unit Parent
procedure
function
protected
Vcl.StdCtrls.pas
Vcl.StdCtrls.hpp
Vcl.StdCtrls TCustomListBox

Description

Generates an OnMeasureItem event.

MeasureItem is called whenever a visual aspect of a variable owner-draw list box changes and the value of the Style property is csOwnerDrawVariable.

Before drawing its items, a variable owner-draw list box calls MeasureItem once for each visible item, passing the index of the item to measure, and the default height of the item. Since Height is passed by reference (a var parameter), MeasureItem can increase or reduce the height of each item as needed.

By default, the MeasureItem method does nothing except call any event handler attached to the OnMeasureItem event. Override MeasureItem to change or add functionality to the default behavior.

See Also