BACKGROUND-COLOUR-NAME

Provides a choice of existing background colors.

When setting background colors, you have four possibilities:

  • Use the BACKGROUND-COLOUR-NAME attribute and leave the value at DEFAULT (0). The color will then be determined by your color settings in the operating system.

  • Use the BACKGROUND-COLOUR-NAME attribute and choose from one of the dialog editor's predefined colors. These are represented by the values 1 to 18.

  • Define your own color by using the BACKGROUND-COLOUR-VALUE attribute in a dialog editor attributes window. To do so, you must first set the BACKGROUND-COLOUR-NAME attribute to CUSTOM (50). A dialog box appears where you can set values for the red, green, and blue elements of your color (RGB model).

  • Set the color dynamically in event handler code by assigning a value to the attribute.

Note:
Due to consistency constraints imposed by Windows, the specified setting may not be effective for particular dialog element types, depending on the version of Windows in use and whether visual themes are enabled.

Applies to Canvas control, control box control, dialog (all types), date/time picker control, dialog bar control, edit area control, group frame control, image control, input field control, list box control, list view control, OLE container control, progress bar control, push button control, radio button control, rectangle control, scroll bar control, selection box control, signal, tab control, table control, text constant control, toggle button control, tree view control, wallpaper control.
Data Type I4
Default Value DEFAULT (0)
Possible Values See table below.

Possible Values

DEFAULT (0) WHITE (1) BLACK (2)
LTGRAY (3) GRAY (4) DKGRAY (5)
RED (6) GREEN (7) BLUE (8)
CYAN (9) MAGENTA (10) BROWN (11)
YELLOW (12) LIGHTRED (13) LIGHTGREEN (14)
LIGHTBLUE (15) LIGHTCYAN (16) LIGHTMAGENTA (17)
BRIGHTWHITE (18) CUSTOM (50)  

Note:
The text representation can be substituted for the integer representation because the local data area NGULKEY1 (supplied in library SYSTEM) is automatically included in the event handler code.