Foreground Color (ForeColor)

Color to use as the foreground (usually the text color).

"ForeColor=ColorName | HexColorNumber | RGBColor"

Value

Description
ColorName Name of a web color or system color. For more information, see Standard Colors .
HexColorNumber Hexadecimal number (prefixed by a hash mark) of a color. For example: #D90E1A.
RGBColor RGB (Red Green Blue) numeric values in the form R,G,B. For example 255,0,0

Usage

Dynamic? Yes for widgets, No for other objects
Supported in Grid? Depends on widget
Dependencies: Depends on widget. See Dependencies and Limitations

Description

Uniface follows Windows behavior in applying colors. Depending on the Windows version and the widget, the color may not always be applied. On Windows Vista, the color determined by the theme takes precedence over the foreground and background color values.

All widgets accept the property, but some will ignore it. For example, forecolor is not supported for Radio Group and CheckBox widgets because Microsoft Windows does not allow the text of the underlying control to be changed.

For command buttons, this property is applied only when Representation is set to Uniface.

Dependencies and Limitations

For command buttons, this property is applied only when Representation is set to Uniface.

For labels and widgets that support the Inherit Colors property, if Inherit Colors is set to true, the widget inherits its foreground and background color from the entity. For more information, see Inherit Colors (InheritColors).

Caution: Avoid combining Uniface index colors with the Foreground and Background properties. For example, if you have set the Foreground and Background colors, you should not use curoccvideo or fieldvideo because these statements set an index color. When the item loses focus, the color is restored to the default index color, not to the Foreground and Background colors.

Setting Widget Colors in ProcScript

The following code example builds a list of properties (vProperties) and assigns them to the widget of field FLD1:

putitem/id vProperties,"backcolor","lightskyblue"
putitem/id vProperties,"forecolor","#000000"
$entityproperties(FLD1)=vProperties

The widget now has a light blue background and black foreground (text).

Setting in ProcScript for Entities

It is possible to set the Foreground Color of an entity in the IDE, or using the $entityproperties and $curEntProperties ProcScript functions.

Related Topics