PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Font variable
  • Color of the icon bar of the window
  • Color of an edit control
  • Text color in a Static control
  • Text color of a Button control
  • Color of the text in a Radio Button or Check Box control
  • Color of the text in a List Box or Combo Box control
  • Color of a TreeView control
  • Text color of a cell, row or column in a Table control
  • Color of a ListView control
  • Color of an Image control
  • Color of the tabs in a Tab control
  • Color of a Sidebar control
  • Color of a Bar Code 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
The Color property is used to get or change the font color for:
  • a Font variable.
  • text displayed in a Static or Calculated control of a report.
  • text displayed in a window control.
  • text displayed in a page control.
  • Versions 16 and later
    text in a menu option.
    New in version 16
    text in a menu option.
    text in a menu option.
The effects of the Color property depend on the type of control (for more details, see "Remarks").
Remark: A Font variable is black by default.
Versions 15 and later
Android This property is now available for Android applications.
New in version 15
Android This property is now available for Android applications.
Android This property is now available for Android applications.
Versions 17 and later
iPhone/iPad This property is now available for window controls and Font variables in iPhone/iPad applications.
New in version 17
iPhone/iPad This property is now available for window controls and Font variables in iPhone/iPad applications.
iPhone/iPad This property is now available for window controls and Font variables in iPhone/iPad applications.
Versions 18 and later
iPhone/iPad This property is now available for report controls in iPhone/iPad applications.
Android Widget This property is now available in Android Widget mode.
New in version 18
iPhone/iPad This property is now available for report controls in iPhone/iPad applications.
Android Widget This property is now available in Android Widget mode.
iPhone/iPad This property is now available for report controls in iPhone/iPad applications.
Android Widget This property is now available in Android Widget mode.
Versions 19 and later
WEBDEV - Browser code This function is now available in browser code for Table controls in browser mode.
New in version 19
WEBDEV - Browser code This function is now available in browser code for Table controls in browser mode.
WEBDEV - Browser code This function is now available in browser code for Table controls in browser mode.
Versions 20 and later
AndroidiPhone/iPad This property is now available for Table controls and table columns in Android and iPhone/iPad applications.
New in version 20
AndroidiPhone/iPad This property is now available for Table controls and table columns in Android and iPhone/iPad applications.
AndroidiPhone/iPad This property is now available for Table controls and table columns in Android and iPhone/iPad applications.
Versions 21 and later
Universal Windows 10 App This property is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This property is now available in Universal Windows 10 App mode.
Universal Windows 10 App This property is now available in Universal Windows 10 App mode.
Versions 22 and later
Universal Windows 10 App This property is now available in Universal Windows 10 App mode for Font variables.
New in version 22
Universal Windows 10 App This property is now available in Universal Windows 10 App mode for Font variables.
Universal Windows 10 App This property is now available in Universal Windows 10 App mode for Font variables.
Example
// The text color is modified according to the displayed value
IF EDT_Total>15000 THEN
EDT_Total.Color = LightRed
END
WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppiPhone/iPadIOS WidgetMac CatalystUser code (UMC)PHPAjax
// Define the characteristics of a Font variable
Font1 is Font
Font1.Name = "Arial"
Font1.Size = 14
Font1.Color = LightYellow
// Apply the font to "MyControl"
MyControl.Font = Font1
Syntax

Finding out the text color Hide the details

<Result> = <Element used>.Color
<Result>: Integer or constant
Color of specified element. This color can correspond to:
WEBDEV - Browser code The color is returned in the format of a character string by the browser.
<Element used>: Name of control or Font variable
Name of element for which the text color must be found. This element can correspond to:
  • the name of a control in a window or in a page.
  • the name of a report control.
  • name of a variable of type Font.

Modifying the text color Hide the details

<Element used>.Color = <New color>
<Element used>: Name of control or Font variable
Name of element for which the text color must be modified. This element can correspond to:
  • the name of a control in a window or in a page.
  • the name of a report control.
  • name of a variable of type Font.
<New color>: Integer or constant
New color for the specified element. This color can correspond to:
Remarks
WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppiPhone/iPadIOS WidgetMac CatalystUser code (UMC)PHPAjax

Font variable

A font can be created from a Font variable.
To define the font characteristics, use:
This font can be used:
Assigning a font to a control:
  • if the Font variable has no specific color, the color of the text displayed in the control is kept.
  • if the Font variable has a specific color, this color is applied to the text displayed in the control.
WINDEVJavaUser code (UMC)

Color of the icon bar of the window

  • If the window is a "MDI parent" window, the Color property allows you to get and change the color of the window's icon bar.
  • The Color property is ignored if the window is not an "MDI parent" window.

Color of an edit control

The Color property is used to get and change the color of the text entered in a control.
WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetMac CatalystJavaUser code (UMC)PHPAjax

Text color in a Static control

The Color property is used to get and change the text color of a Static control.
WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadMac CatalystJavaUser code (UMC)PHPAjax

Text color of a Button control

The Color property is used to get and change the text color of a Button control.
WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppAndroidiPhone/iPadMac CatalystJavaUser code (UMC)PHPAjax

Color of the text in a Radio Button or Check Box control

The Color property is used to get and change the text color of all the options of a Radio Button or Check Box control.
WINDEVWEBDEV - Browser codeReports and QueriesUniversal Windows 10 AppAndroidiPhone/iPadMac CatalystJavaUser code (UMC)PHP

Color of the text in a List Box or Combo Box control

The Color property is used to get and change the text color of all the options in a List Box control.
WINDEVWINDEV Mobile To get or change the text color of an option in a List Box control, specify the element using the following syntax: ListName[RowNum].
For example, the following code is used to color the text of the second row of the List Box control green:
LIST_List1[2].Color = LightGreen

Caution: In List Box controls, the new color is kept for the visible rows only.
WINDEVWEBDEV - Server codeJavaUser code (UMC)PHPAjax

Color of a TreeView control

The Color property is used to get and change the color of all the labels displayed in a TreeView control.
To find out or modify the text color of an option in the TreeView control, specify the element with one of the following syntaxes:
  • TreeViewName[RowNum]
  • TreeViewName[<Element path>] where Element path is a character string in the following format:
    "<Name of root>" + TAB + ["<Name of 1st node>" + TAB +...
    ["<Name of 2nd node>" + TAB + [...]]]"<Leaf name>"
    Examples:
TREE_TreeView2[2].Color = LightGreen // Colors the second row green
TREE_MyTreeView["Recipe" + TAB + "Dessert"].Color = LightRed
WINDEVWEBDEV - Server codeWEBDEV - Browser codeAndroidiPhone/iPadMac CatalystJavaUser code (UMC)PHPAjax

Text color of a cell, row or column in a Table control

  • To find out or modify the text color of an option in a Table control, specify the cell with the following syntax: TableName[RowNum][ColumnNum].
    For example, the following code is used to modify the color of the text displayed in the cell on the first row, second column:
    TABLE_Table1[1][2].Color = DarkBlue
  • To find out or modify the text color of a row in a Table control, specify the row with the following syntax: TableName[RowNum].
  • To get or change the text color of a column in a Table control, simply use the Color property with the column name.
Caution: To keep the text color when selecting a row in a browsing Table control, simply use the Color property in the "Selecting a row" event.
Versions 19 and later
WEBDEV - Browser code The Color property is available in browser code only for Table controls in browser mode on:
  • Table rows (browser).
  • Table columns (browser).
  • Table cells (browser).
This property is not available in browser code for classic or Ajax Table controls.
New in version 19
WEBDEV - Browser code The Color property is available in browser code only for Table controls in browser mode on:
  • Table rows (browser).
  • Table columns (browser).
  • Table cells (browser).
This property is not available in browser code for classic or Ajax Table controls.
WEBDEV - Browser code The Color property is available in browser code only for Table controls in browser mode on:
  • Table rows (browser).
  • Table columns (browser).
  • Table cells (browser).
This property is not available in browser code for classic or Ajax Table controls.
WINDEVJavaUser code (UMC)

Color of a ListView control

The Color property is used to get and change the color of all the labels displayed in a ListView control.
To find out or modify the text color of an option in the ListView control, specify the element with the following syntax: ListViewName[RowNum].
For example, the following code is used to color the text of the second row of the ListView control green:
LSV_ListView1[2].Color = LightGreen

Caution: In ListView controls, the new color is kept for the visible rows only.
WINDEVUniversal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetMac CatalystJavaUser code (UMC)

Color of an Image control

The Color property is used to get and change the background color of an Image control.
WINDEViPhone/iPadMac CatalystJavaUser code (UMC)

Color of the tabs in a Tab control

When used on a Tab control, the Color property allows you to get and change the background color of the tabs.
When used on a tab, the Color property allows you to get and change the text color of the tabs.
For example:
// Modifies the color of the caption for pane 1
TAB_MyTab[1].Color = LightRed
WINDEVUser code (UMC)

Color of a Sidebar control

The Color property is used to get and change the background color of the sidebar panes.
WINDEVUser code (UMC)

Color of a Bar Code control

The Color property is used to get and change the color of the bar code design.

Limitations

WINDEVWEBDEV - Server codeReports and QueriesUniversal Windows 10 AppiPhone/iPadIOS WidgetMac Catalyst Limitations on report controls
The Color property has no effect on:
  • Image controls.
  • Bar Code controls.
  • RTF controls.
  • Check Box controls.
  • Chart controls.
  • Versions 21 and later
    Signature controls.
    New in version 21
    Signature controls.
    Signature controls.
  • reports.
  • report blocks.
WINDEV Limitations on controls in WINDEV windows
The Color property has no effect on the following controls:
  • HTML controls,
  • Web Camera controls,
  • supercontrols,
  • Slider controls.
WEBDEV - Browser code The Color property works only on the following controls:
  • edit controls.
  • List Box controls.
  • Combo Box controls.
  • Static controls.
  • elements of a List Box control.
  • elements of a Combo Box control.
  • HTML Static controls.
  • 3-state Button controls.
  • formatted display controls.
  • Versions 19 and later
    browser table rows.
    New in version 19
    browser table rows.
    browser table rows.
  • Versions 19 and later
    browser table columns.
    New in version 19
    browser table columns.
    browser table columns.
  • Versions 19 and later
    browser table cells.
    New in version 19
    browser table cells.
    browser table cells.
Java The Color property applies only to 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.
  • Table column.
Android Widget The Color property applies only to the following elements:
  • Button control.
  • Static control.
  • Image control.
IOS Widget The Color property applies only to the following elements:
  • Static control.
  • Image control.
  • Window.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment