4D v14.3

LISTBOX SET ROW FONT STYLE

Home

 
4D v14.3
LISTBOX SET ROW FONT STYLE

LISTBOX SET ROW FONT STYLE 


 

LISTBOX SET ROW FONT STYLE ( {* ;} object ; row ; style ) 
Parameter Type   Description
Operator in If specified, object is an object name (string) If omitted, object is a variable
object  Form object in Object name (if * is specified) or
Variable (if * is omitted)
row  Longint in Row number
style  Longint in Font style

Note: This command only works with array type list boxes.

The LISTBOX SET ROW FONT STYLE command sets a font style for a row or a cell in the array type list box designated by the object and * parameters.

Passing the optional * parameter indicates that the object parameter is an object name (string). If you do not pass this parameter, it indicates that the object parameter is a is a variable. In this case, you pass a variable reference instead of a string.

You can designate a list box or a list box column in the object parameter:

  • When object designates a list box, the command applies to the row.
  • When object designates a list box column, the command applies to the cell located at the column/row intersection.

In row, pass the number of the row where you want to apply the new style. 

Note: The command does not take any hidden/shown states of the list box rows into account.

In style, you pass a style value. You must use one (or a combination) of the constants found in the Font Styles theme: 

Constant Type Value
Bold Longint 1
Italic Longint 2
Plain Longint 0
Underline Longint 4

If an array of font styles has been associated with the list box or column, only the element matching the row is modified. In other words, executing the command has the same effect, in this case, as modifying an element of the font style array.
If there is no font style array associated with the list box or column, one will be created dynamically when this command is called. You can access them using the LISTBOX Get array command.

If conflicting style properties are set for the column or the list box, an order of priority is applied. For more information, refer to the Design Reference manual.

Note: Since style arrays for columns take priority over the ones for list boxes, when this command is applied to a list box, it will only have an effect if no style array has been assigned to the columns.

Example  

Given an array type list box with the following characteristics:

  • a font style array associated with the list box (ArrGlobalStyle)
  • a font style array associated with column 5 (ArrCol5Style)
  • the other columns do not have any style arrays.

 LISTBOX SET ROW FONT STYLE(*;"Col5";3;Bold)
  // equivalent to ArrCol5Style{3}:=Bold

 LISTBOX SET ROW FONT STYLE(*;"List Box";3;Italic+Underline)
  // equivalent toArrGlobalStyle{3}:=Italic+Underline

After the second statement, all the cells of the third row change to underlined italic, except for the one in the 5th column which stays in bold only (column style arrays take priority over list box arrays).

 
PROPERTIES 

Product: 4D
Theme: List Box
Number: 1268

 
HISTORY 

New
Created: 4D v14

 
SEE ALSO 

LISTBOX Get row font style
LISTBOX SET ROW COLOR

 
ARTICLE USAGE

4D Language Reference ( 4D v14 R2)
4D Language Reference ( 4D v14 R3)
4D Language Reference ( 4D v14.3)
4D Language Reference ( 4D v14 R4)