defaultLineHeight

Type: Integer

Availability: Read or write at any time

The defaultLineHeight property of the ComboBox class and the ListBox class specifies the default height of lines in a combo box or list box, independent of the font. This property represents pixels and defaults to zero (0), indicating that the height of the line is determined by the font selected for the combo box or list box.

If the value of the property is greater than the height of the font in the combo box or list box, the value of the defaultLineHeight property is used to determine the line height of the list. If the value is less than the height of the font, the list line height is determined from the combo box or list box font.

This property for a combo box control, implemented from version 2020.0.01, has no impact on the size of the combo box itself; only the height of the list items when the list is displayed. To assist touchscreen users, it enables you to specify the default line height of a list in a combo box (for example, cbt.defaultLineHeight := 25;).

The code fragment in the following example sets the height of the lines in a list box to two pixels higher than the font size.

if listbox1.defaultLineHeight = 0 then
    listbox1.defaultLineHeight := listbox1.getLineHeight() + 2;
endif;

If the value of the defaultLineHeight property is greater than zero (0), the ListBox class getLineHeight method returns that value. See also the Table class defaultRowHeight property.