ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage properties / Various properties
  • Background color of an Edit control
  • Background color of a List Box or Combo Box control
  • Background color of the window
  • Background color of a Static Text control
  • Background color of a Button control
  • Background color of a Radio Button or Check Box control
  • Background color of a ListView control
  • Background color of a TreeView control
  • Background color of a Table control and its cells, columns or rows
  • Background color of a cell
  • Background color of a Tab control
  • Background color of a Sidebar control
  • Background color of a Scrollbar or Spin control
  • Limitations
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Warning
From version 24, BrushColor is kept for backward compatibility. This property has been replaced with BackgroundColor.
The BackgroundColor property gets and sets the background color of:
  • a control.
  • a window.
  • a page.
  • a report block.
  • text in a menu option.
Note: Depending on the type of field, the effects of the BackgroundColor property may vary (see the "Notes" paragraph for more details).
New in version 2025
WINDEV The CouleurFond property is now available in the Image Editor control in a window..
Example
// Selon la valeur affichée, la couleur de fond est modifiée
IF SAI_Total > 15000 THEN
	SAI_Total.CouleurFond = LightRed
END
Syntax

Determining the background color Hide the details

<Background color> = <Element used>.BackgroundColor
<Background color>: Integer or constant
Color of the specified element. Corresponds to one of the following options:
WEBDEV - Browser code The color is returned as a string by the browser.
<Element used>: Type of element
Name of element to be manipulated: control, window, page or report block.

Changing the background color Hide the details

<Element used>.BackgroundColor = <New color>
<Element used>: Type of element
Name of the element to be manipulated: control, window, page or report block.
<New color>: Integer or constant
New color of the specified element. Corresponds to one of the following options:
Remarks
WINDEVWEBDEV - Server codeWEBDEV - Browser codeAndroidiPhone/iPadMac CatalystJavaUser code (UMC)PHPAjax

Background color of an Edit control

The BackgroundColor property gets and sets the background color of the text entered in a control.
Background color of an Edit control
WINDEVWEBDEV - Server codeWEBDEV - Browser codeAndroidiPhone/iPadMac CatalystJavaUser code (UMC)PHPAjax

Background color of a List Box or Combo Box control

The BackgroundColor property gets and sets the background color of:
  • All the options of the control.
  • A single option.
    WEBDEV - Server codeWEBDEV - Browser codePHPAjax This feature is not available in WEBDEV.
WINDEVAndroidiPhone/iPadMac CatalystJavaUser code (UMC) To get or change the background color of an option in the List Box control, use the following syntax:
NomChampListe[NumLigne]

For example, the following code changes the background color of the second row in the List Box control:
LISTE_Liste1[2].CouleurFond = LightGreen

Attention: For lines in a List Box control, the new color is retained only for visible lines..
Background color of a List Box control
WINDEVAndroidAndroid Widget iPhone/iPadIOS WidgetMac CatalystJavaUser code (UMC)

Background color of the window

If the window is not an "MDI parent" window, the BackgroundColor property allows you to get and change the background color of the window's client area.
WINDEVWEBDEV - Server codeWEBDEV - Browser codeAndroidAndroid Widget iPhone/iPadIOS WidgetMac CatalystJavaUser code (UMC)PHPAjax

Background color of a Static Text control

The BackgroundColor property gets and sets the background color of the text in a Static Text control.
Background color of a Static Text control
WINDEVWEBDEV - Server codeWEBDEV - Browser codeAndroidAndroid Widget iPhone/iPadMac CatalystJavaUser code (UMC)PHPAjax

Background color of a Button control

The BackgroundColor property is used to change the background color of a Button control.
WINDEVWEBDEV - Server codeWEBDEV - Browser codeAndroidiPhone/iPadMac CatalystJavaUser code (UMC)PHPAjax

Background color of a Radio Button or Check Box control

The BackgroundColor property gets and sets the background color of a Radio Button or Check Box control.
Background color of a Radio Button control
WINDEVJavaUser code (UMC)

Background color of a ListView control

The BackgroundColor property gets and sets the background color of:
  • All the options of the ListView control.
  • A single option.
To get or change only the background color of an option in the ListView control, use the following syntax:
<Champ Liste Image>[NumLigne]

Example: the following code changes the background color of the second row in the ListView control:
LSI_ListeImage1[2].CouleurFond = LightGreen
WINDEVWEBDEV - Server codeJavaUser code (UMC)PHPAjax

Background color of a TreeView control

The BackgroundColor property gets and sets the background color of:
  • All the options of the TreeView control.
  • A single option.
To get or change the background color of an option in the TreeView control, use the following syntax:
<Champ Arbre>[NumLigne]

Example: the following code changes the background color of the second row in the TreeView control:
ARBRE_Arbre1[2].CouleurFond = LightGreen
WINDEVWEBDEV - Server codeWEBDEV - Browser codeAndroidiPhone/iPadMac CatalystJavaUser code (UMC)PHPAjax

Background color of a Table control and its cells, columns or rows

Used on the entire Table control, the BackgroundColor property allows you to:
  • Delete the colors specific to the cells and columns via the following syntax:
    <Champ Table>.CouleurFond = CouleurDéfaut
  • Change the background color of all the columns in the Table control (especially columns and cells with no background color). For example, the following code applies blue color to all the columns:
    <Champ Table>.CouleurFond = BleuFoncé
This property gets and sets the background color of a cell in a Table control. The following syntax must be used to specify the cell:
<Champ Table>[NumLigne][NumColonne]
Example: The following code changes the background color of the cell in the first row of the second column.
TABLE_Table1[1][2].CouleurFond = DarkBlue
Background color of a Table control cell
Caution: To keep the background color when selecting a line in a Table based on a data file field, you need to use the BackgroundColor property in the "Select a table line" process..
WINDEV Remark: You can change the background color style of a cell, column or row in a Table or hierarchical Table field using the BackgroundStyle property.
WEBDEV - Browser code The BackgroundColor property is available in browser code only for Table controls in "Browser" mode on:
  • Rows of the Table control (browser).
  • Columns of the Table control (browser).
  • Cells of the Table control (browser).
This property is not available in browser code for Table controls in "Server" or "Server + AJAX" mode.
WEBDEV - Browser code

Background color of a cell

The BackgroundColor property gets and sets the background color of cells in WEBDEV pages.
WINDEVJavaUser code (UMC)

Background color of a Tab control

For Tab controls:
  • For the tabs:
    • The Color property gets and sets the text color in the tabs.
    • When used on tabs, the BackgroundColor property gets and sets the background color of the tabs.
  • For the Tab Control field: the BackgroundColor property lets you define and modify the background color of the Tab Control field (background color of tabs, tab panes and color appearing behind tabs).
WINDEVUser code (UMC)

Background color of a Sidebar control

The BackgroundColor property gets and sets the background color of the Sidebar control (color used for the background of tabs). The Color property gets and sets the background color of the sidebar panes.
WINDEVUser code (UMC)

Background color of a Scrollbar or Spin control

The BackgroundColor property changes the background color of a Scrollbar control (color of the scrollbar track).

Limitations

WINDEVWEBDEV - Server codeReports and QueriesiPhone/iPadIOS WidgetMac Catalyst Limitations on report controls
The BackgroundColor property has no effect on:
  • reports (as a whole).
  • Internal Report controls.
  • Signature controls.
WINDEV Limitations on controls in WINDEV windows
The BackgroundColor property has no effect on the following controls:
  • HTML controls,
  • Web Camera controls,
  • Slider controls.
WEBDEV - Server code Limitations on page controls
The BackgroundColor property has no effect on the elements of a List Box or Combo Box control.
WEBDEV - Browser code In browser code, the BackgroundColor property works only on the following controls:
  • edit controls,
  • List Box controls and elements in a List Box control,
  • Combo Box controls and elements in a Combo Box control,
  • rows of a Table control,
  • Static and HTML Static controls.
  • 3-state Button controls.
  • Check Box and Radio Button controls.
  • Image controls.
  • "Formatted display" controls.
  • Link controls.
  • HTML controls.
  • cells.
  • Thumbnail controls.
  • iFrame controls.
  • rows of a Table control in "Browser" mode.
  • columns of a Table control in "Browser" mode.
  • cells of a Table control in "Browser" mode.
The BackgroundColor property can also be used on pages.
Java The BackgroundColor property can only be used with the following elements:
  • Button control.
  • Static Text control.
  • Edit control.
  • Image control.
  • Check Box control.
  • Radio Button control.
  • List Box control.
  • Combo Box control.
  • TreeView control.
  • Tab control.
  • Window.
  • Table control.
  • Table Column control.
Android Widget The BackgroundColor property can only be used with the following elements:
  • Button control.
  • Static Text control.
  • Image control.
  • Window.
IOS Widget The BackgroundColor property can only be used with the following elements:
  • Static Text control.
  • Image control.
  • Window.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/20/2024

Send a report | Local help