LISTBOX SET AUTO ROW HEIGHT
LISTBOX SET AUTO ROW HEIGHT ( {* ;} object ; selector ; value ; unit )
Parameter | Type | Description | |
---|---|---|---|
* | Operator | → | If specified, object is an object name (string). If omitted, object is a variable. |
object | any | → | Object name (if * is specified) or Variable (if * is omitted) |
selector | Integer | → | Height value to set: lk row min height or lk row max height |
value | Integer | → | Minimum or maximum row height value |
unit | Integer | → | Unit of height value: 0 = pixels, 1 = lines |
This command is not thread-safe, it cannot be used in preemptive code.
Description
The LISTBOX SET AUTO ROW HEIGHT command allows you to set the minimum or maximum row height value in the list box object designated using the object and * parameters.
Note: This command is taken into account only if the list box is set to automatic row height mode (see Automatic Row Height), which is only available for "collection or entity selection" and "array" list boxes. Otherwise, it has no effect.
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 set. You can use one of the following constants from the List Box theme:
Constant | Type | Value |
---|---|---|
lk row max height | Longint | 33 |
lk row min height | Longint | 32 |
In value, pass the corresponding value in the appropriate unit.
The unit parameter can be set using one of the following constants from the List Box theme:
Constant | Type | Value | Comment |
---|---|---|---|
lk lines | Longint | 1 | Height is expressed as a number of lines. 4D calculates the height of a line according to the font. |
lk pixels | Longint | 0 | Height is expressed as a number of pixels (default). |
Note: The command does not check the consistency of the values. However, at runtime, the minimum value will be applied to both values in case of conflict. For example, if the minimum value is 5 lines and the maximum value is 3 lines (which is inconsistent), the maximum height applied to the list box rows will be 5 lines.
Example
You want to set the minimum and maximum heights for a list box with an automatic row height:
LISTBOX SET AUTO ROW HEIGHT(*;"LB";lk row min height;60;lk pixels) // 60 pixels for min value
LISTBOX SET AUTO ROW HEIGHT(*;"LB";lk row max height;100;lk pixels) //and 100 pixels for max value
See also
LISTBOX Get auto row height
LISTBOX SET ROW HEIGHT
LISTBOX SET ROWS HEIGHT