Skip to main content
Version: 18

Background and Border

Alternate Background Color

Allows setting a different background color for odd-numbered rows/columns in a list box. By default, Automatic is selected: the column uses the alternate background color set at the list box level.

JSON Grammar

NameData TypePossible Values
alternateFillstringany css value; "transparent"; "automatic"

Objects Supported

List Box - List Box Column


Background Color / Fill Color

Defines the background color of an object.

In the case of a list box, by default Automatic is selected: the column uses the background color set at the list box level.

JSON Grammar

NameData TypePossible Values
fillstringany css value; "transparent"; "automatic"

Objects Supported

Hierarchical List - List Box - List Box Column - List Box Footer - Oval - Rectangle - Text Area

See also

Transparent


Background Color Expression

Selection and collection type list boxes

An expression or a variable (array variables cannot be used) to apply a custom background color to each row of the list box. The expression or variable will be evaluated for each row displayed and must return a RGB color value. For more information, refer to the description of the OBJECT SET RGB COLORS command in the 4D Language Reference manual.

You can also set this property using the LISTBOX SET PROPERTY command with lk background color expression constant.

With collection or entity selection type list boxes, this property can also be set using a Meta Info Expression.

JSON Grammar

NameData TypePossible Values
rowFillSourcestringAn expression returning a RGB color value

Objects Supported

List Box - List Box Column


Border Line Style

Allows setting a standard style for the object border.

JSON Grammar

NameData TypePossible Values
borderStyletext"system", "none", "solid", "dotted", "raised", "sunken", "double"

Objects Supported

4D View Pro Area - 4D Write Pro areas - Buttons - Button Grid - Hierarchical List - Input - List Box - Picture Button - Picture Pop-up Menu - Plug-in Area - Progress Indicator - Ruler - Spinner - Stepper - Subform - Text Area - Web Area


Dotted Line Type

Describes dotted line type as a sequence of black and white points.

JSON Grammar

NameData TypePossible Values
strokeDashArraynumber array or stringEx. "6 1" or [6,1] for a sequence of 6 black point and 1 white point

Objects Supported

Rectangle - Oval - Line


Hide extra blank rows

Controls the display of extra blank rows added at the bottom of a list box object. By default, 4D adds such extra rows to fill the empty area:

You can remove these empty rows by selecting this option. The bottom of the list box object is then left blank:

JSON Grammar

NameData TypePossible Values
hideExtraBlankRowsbooleantrue, false

Objects Supported

List Box


Line Color

Designates the color of the object's lines. The color can be specified by:

  • a color name - like "red"
  • a HEX value - like "#ff0000"
  • an RGB value - like "rgb(255,0,0)"

You can also set this property using the OBJECT SET RGB COLORS command.

JSON Grammar

NameData TypePossible Values
strokestringany css value, "transparent", "automatic"

This property is also available for text based objects, in which case it designates both the font color and the object's lines, see Font color.

Objects Supported

Line - Oval - Rectangle


Line Width

Designates the thickness of a line.

JSON Grammar

NameData TypePossible Values
strokeWidthnumber0 for smallest width on a printed form, or any integer value < 20

Objects Supported

Line - Oval - Rectangle


Row Background Color Array

Array type list boxes

The name of an array to apply a custom background color to each row of the list box or column.

The name of a Longint array must be entered. Each element of this array corresponds to a row of the list box (if applied to the list box) or to a cell of the column (if applied to a column), so the array must be the same size as the array associated with the column. You can use the constants of the SET RGB COLORS theme. If you want the cell to inherit the background color defined at the higher level, pass the value -255 to the corresponding array element.

For example, given a list box where the rows have an alternating gray/light gray color, defined in the properties of the list box. A background color array has also been set for the list box in order to switch the color of rows where at least one value is negative to light orange:

 <>_BgndColors{$i}:=0x00FFD0B0 // orange
<>_BgndColors{$i}:=-255 // default value

Next you want to color the cells with negative values in dark orange. To do this, you set a background color array for each column, for example <>_BgndColor_1, <>_BgndColor_2 and <>_BgndColor_3. The values of these arrays have priority over the ones set in the list box properties as well as those of the general background color array:

 <>_BgndColorsCol_3{2}:=0x00FF8000 // dark orange
<>_BgndColorsCol_2{5}:=0x00FF8000
<>_BgndColorsCol_1{9}:=0x00FF8000
<>_BgndColorsCol_1{16}:=0x00FF8000

You can get the same result using the LISTBOX SET ROW FONT STYLE and LISTBOX SET ROW COLOR commands. They have the advantage of letting you skip having to predefine style/color arrays for the columns: instead they are created dynamically by the commands.

JSON Grammar

NameData TypePossible Values
rowFillSourcestringThe name of a longint array.

Objects Supported

List Box - List Box Column


Transparent

Sets the list box background to "Transparent". When set, any alternate background color or background color defined for the column is ignored.

JSON Grammar

NameData TypePossible Values
filltext"transparent"

Objects Supported

List Box

See also

Background Color / Fill Color