Skip to main content
Version: Next

LISTBOX Get auto row height

LISTBOX Get auto row height ( {* ;} object ; selector {; unit} ) : Integer

ParameterTypeDescription
*OperatorIf specified, object is an object name (string). If omitted, object is a variable.
objectanyObject name (if * is specified) or Variable (if * is omitted)
selectorIntegerHeight value to get: lk row min height or lk row max height
unitIntegerUnit of height value: 0 = pixels, 1 = lines
Function resultIntegerSelected row height value

This command is not thread-safe, it cannot be used in preemptive code.

Description

The LISTBOX Get auto row height command returns the current minimum or maximum row height value set for the list box object designated using the object and * parameters.

The current minimum or maximum row height value can be set either in the Property list (see Automatic Row Height) or in the current process using the LISTBOX SET AUTO ROW HEIGHT command.

Note: This command can be used with "collection or entity selection" and "array" list boxes only.

If you pass the optional * parameter, you indicate that the object parameter is an object name (string). If you do not pass this parameter, you indicate that the object parameter is a variable. In this case, you pass a variable reference instead of a string. For more information about object names, refer to the Object Properties section.

In selector, pass the type of value to get. You can use one of the following constants from the List Box theme:

ConstantTypeValue
lk row max heightInteger33
lk row min heightInteger32

By default, the command returns the value in pixels. You can pass one of the following constants from the List Box theme in the unit parameter to define the unit to use:

ConstantTypeValueComment
lk linesInteger1Height is expressed as a number of lines. 4D calculates the height of a line according to the font.
lk pixelsInteger0Height is expressed as a number of pixels (default).

Example

You want to get the maximum number of lines for a list box row:

 var vhMaxInteger
 vhMax:=LISTBOX Get auto row height(*;"LB";lk row max height;lk lines)

See also

LISTBOX Get row height
LISTBOX Get rows height
LISTBOX SET AUTO ROW HEIGHT