ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

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 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 Tab control
  • Background color of a Sidebar control
  • Background color of a Scrollbar or Spin control
  • Limitations
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Warning
From version 24, BrushColor is kept for backward compatibility. This property is replaced by BackgroundColor.
The BackgroundColor property is used to get and change the background color of:
  • a control.
  • a window.
  • a page.
  • a report block.
  • text in a menu option.
Remark: The effects of the BackgroundColor property depend on the type of control (for more details, see "Remarks").
Example
// The background color is modified according to the displayed value
IF EDT_Total > 15000 THEN
EDT_Total.BackgroundColor = 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:
<Element used>: Type of element
Name of the element to be used: 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 used: control, window, page or report block.
<New color>: Integer or constant
New color for the specified element. Corresponds to one of the following options:
Remarks
WINDEVUniversal Windows 10 AppJavaUser code (UMC)

Background color of an Edit control

The BackgroundColor property is used to get and change the background color of the text entered in a control.
Background color of an Edit control
WINDEVUniversal Windows 10 AppJavaUser code (UMC)

Background color of a List Box or Combo Box control

The BackgroundColor property is used to get and change the background color of:
  • All the options of the control.
  • A single option.
WINDEVUniversal Windows 10 AppJavaUser code (UMC) To get or change the background color of an option in the List Box control, use the following syntax:
ListBoxControlName[RowNum]

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

Caution: In List Box controls, the new color is kept for the visible rows only.
Background color of a List Box control
WINDEVUniversal Windows 10 AppJavaUser code (UMC)

Background color of the window

If the window is not a "MDI parent" window, the BackgroundColor property allows you to get and change the background color of the window's client area.
WINDEVUniversal Windows 10 AppJavaUser code (UMC)

Background color of a Static control

The BackgroundColor property is used to get and change the background color of the text in a Static control.
Background color of a Static control
WINDEVUniversal Windows 10 AppJavaUser code (UMC)

Background color of a Button control

The BackgroundColor property is used to change the background color of a Button control.
WINDEVUniversal Windows 10 AppJavaUser code (UMC)

Background color of a Radio Button or Check Box control

The BackgroundColor property is used to get and change 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 is used to get and change 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:
<ListView control>[RowNum]

Example: the following code changes the background color of the second row in the ListView control:
LSV_ListView1[2].BackgroundColor = LightGreen
WINDEVJavaUser code (UMC)

Background color of a TreeView control

The BackgroundColor property is used to get and change 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:
<TreeView control>[RowNum]

Example: the following code changes the background color of the second row in the TreeView control:
TREE_TreeView1[2].BackgroundColor = LightGreen
WINDEVJavaUser code (UMC)

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:
    <Table control>.BackgroundColor = DefaultColor
  • 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:
    <Table control>.BackgroundColor = DarkBlue
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:
<Table control>[RowNum][ColumnNum]
Example: The following code changes the background color of the cell in the first row of the second column.
TABLE_Table1[1][2].BackgroundColor = DarkBlue
Background color of a Table control cell
Caution: To keep the background color when selecting a row in a Table control based on a data file, simply use the BackgroundColor property in the "Select a row" process.
WINDEV Remark: To change the style of the background color of a cell, column or row in a Table or TreeView Table control, use the BackgroundStyle property.
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: The BackgroundColor property gets and sets the background color of the entire Tab control (color used for the tabs, tab panes and area behind the 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

WINDEVUniversal Windows 10 App 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.
Java The BackgroundColor property can only be used with the following elements:
  • Button control.
  • Static control.
  • Edit control.
  • Image control.
  • Check Box control.
  • Radio Button control.
  • List Box control.
  • Combo Box control.
  • TreeView control.
  • Tab control.
  • Window.
  • Table control.
  • Column of Table control.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 10/03/2023

Send a report | Local help