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

TCustomCheckListBox.CalculateStandardItemHeight

Calculates the height for an item displayed on the check list control.

Declaration

Source position: checklst.pas line 74

public function TCustomCheckListBox.CalculateStandardItemHeight: Integer; override;

Function result

Height in pixels for a check box item on the control.

Description

CalculateStandardItemHeight is an overridden method used to calculate the height for an item on the check list control.

CalculateStandardItemHeight calls the inherited method on entry to get the height for an item using the Canvas and Font in the class instance. The value is adjusted when needed to the size needed for the SM_CYMENUCHECK system metric. 2 pixels are added to the value as padding, and it is stored in the return value for the method.

CalculateStandardItemHeight is called from the FontChanged method, and occurs when the Font size is changed for the control. It is also called when the LM_MeasureItem is handled in the ancestor class (TCustomListBox).

CalculateStandardItemHeight is used when Style is set to a value other than lbOwnerDrawVariable. Use the OnMeasureItem event handler to calculate the item height when Style is set to lbOwnerDrawVariable.

Version info

Added in LCL version 3.0 as a replacement for the MeasureItem method.

See also

TCustomListBox.OnMeasureItem

  

Handler invoked when the height for an item is needed.

TCustomListBox.CalculateStandardItemHeight

  

Determines the standard Height of the items, when the widget has yet been created.

TCustomListBox.Style

  

Appearance of the list box (standard, owner-draw fixed, or owner-draw variable).

GetSystemMetrics

  

Retrieves various system metrics.


Version 4.0 Generated 2025-05-03 Home