4D v14.3

LISTBOX SET ROW COLOR

Home

 
4D v14.3
LISTBOX SET ROW COLOR

LISTBOX SET ROW COLOR 


 

LISTBOX SET ROW COLOR ( {* ;} object ; row ; color {; colorType} ) 
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
color  Longint in RGB color value
colorType  Longint in Listbox font color (default) or Listbox background color

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

The LISTBOX SET ROW COLOR command sets the color for a row or a cell in the array 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 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 color. 

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

In color, pass an RGB color value. For more information about RGB colors, refer to the description of the OBJECT SET RGB COLORS command. If you want the row to inherit the color set for the higher level, you can pass the Listbox inherited constant in color.

In the colorType parameter, pass the Listbox background color or Listbox font color constants to indicate whether you want to apply the color as the background or the font color of the row. If you omit this parameter, the color is applied as the font color. 

This command modifies values found in the array of colors that may have been defined for the column or list box. If these arrays are not already defined, the command dynamically creates arrays that you can access using the LISTBOX Get array command. 

If conflicting color values are set using properties for list boxes or list box columns, an order of priority is applied. For more information, refer to the Design Reference manual.

Example  

In an array type list box, we want to set colors for a row and for one cell in this row:

  // Definition of font color for cell (yellow)
 LISTBOX SET ROW COLOR(*;"Col5";3;0x00FFFF00)
 
  // Definition of background and font color for row 3
  // red background, blue font
 LISTBOX SET ROW COLOR(*;"ListBox";3;0x00FF0000;Listbox background color)
 LISTBOX SET ROW COLOR(*;"List Box";3;0x000000FF)

 
PROPERTIES 

Product: 4D
Theme: List Box
Number: 1270

 
HISTORY 

New
Created: 4D v14

 
SEE ALSO 

List Box
LISTBOX Get row color
LISTBOX SET ROW FONT STYLE

 
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)