ForeColor

This property returns and sets the foreground color used to display text and graphics in an object.

Syntax

object.ForeColor [= color]

Parameters

object
Object expression that evaluates to a control or Form object.
color
Value or constant that determines the background or foreground colors of an object, as described in Settings.

Visual Basic for Windows CE uses the red-green-blue (RGB) color scheme. Following are the settings for color:

Standard RGB colors
Colors specified by using the Color palette or by using the RGB function in code.
System default colors
Colors specified by system color constants listed in the object library in the Object Browser. Windows CE substitutes the user's choices as specified in the Control Panel settings.

Following are the the default settings at design time for all forms and controls :

ForeColor
Set to the system default color specified by the constant vbWindowText.

Remarks

To display text in Windows CE, both the text and background colors must be solid. If the text or background colors you have selected are not displayed, one of the selected colors may be dithered—that is, comprised of up to three differently colored pixels. If you choose a dithered color for either the text or background, the nearest solid color will be substituted.

Setting the ForeColor property does not affect graphics or print output already drawn. On all other controls, the screen color changes immediately.

The valid range for a normal RGB color is from 0 through 16,777,215 (&HFFFFFF). The high byte of a number in this range equals 0. The lower 3 bytes, from least to most significant byte, determine the amount of red, green, and blue, respectively. The red, green, and blue components are each represented by a number from 0 through 255 (&HFF). If the high byte is not 0, Visual Basic for Windows CE uses the system colors, as defined in the user's Control Panel settings and by constants listed in the Visual Basic object library in the Object Browser.