ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage properties / Various properties
  • Font variable
  • 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
  • Text color of a cell, row or column in a Table control
  • Color of an Image control
  • Color of the tabs in a Tab 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 variable of type Font.
  • text displayed in a Static or Calculated control of a report.
  • text displayed in a window control.
  • text displayed in a page control.
  • 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.
Example
// The text color is modified according to the displayed value
IF EDT_Total>15000 THEN
EDT_Total.Color = LightRed
END
Universal Windows 10 AppiPhone/iPadIOS WidgetMac Catalyst
// Define the characteristics of a Font variable
Font1 is Font
Font1.Name = "Arial"
Font1.Color = LightYellow
Font1.Size = 14
Font1.SizeUnit = unitPoint
Font1.Orientation = 45
// 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 the specified element. This color can correspond to:
<Element used>: Control name 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.

Changing the text color Hide the details

<Element used>.Color = <New color>
<Element used>: Control name 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

Font variable

A font can be created from a Font variable.
To define the font characteristics, use:
This font can be used:
AndroidAndroid Widget This font can only be used in the controls of a window (Font property).
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.

Color of an edit control

The Color property is used to get and change the color of the text entered in a control.
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetMac Catalyst

Text color in a Static control

The Color property is used to get and change the text color of a Static control.
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPadMac Catalyst

Text color of a Button control

The Color property is used to get and change the text color of a Button control.
Universal Windows 10 AppAndroidiPhone/iPadMac Catalyst

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.
Universal Windows 10 AppAndroidiPhone/iPadMac Catalyst

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.
WINDEV 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.
AndroidiPhone/iPadMac Catalyst

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 Table control based on a data file, simply use the Color property in the "Select a row" event.
Universal Windows 10 AppAndroidAndroid Widget iPhone/iPadIOS WidgetMac Catalyst

Color of an Image control

The Color property is used to get and change the background color of an Image control.
iPhone/iPadMac Catalyst

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

Limitations

Universal 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.
  • Signature controls.
  • reports.
  • report blocks.
Android Widget The Color property can only be used with the following elements:
  • Button control.
  • Static control.
  • Image control.
IOS Widget The Color property can only be used with 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

Last update: 10/03/2023

Send a report | Local help