BackColor, ForeColor Properties

Example   Applies To   See Also

Specifies the background or foreground color used to display text and graphics in an object. Available at design time and run time.

Syntax

Object.BackColor[ = nColor]

Object.ForeColor[ = nColor]

Settings

nColor

Specifies a single color value.

The following table lists typical color values.

Color RGB Values nColor Value
White 255, 255, 255 16777215
Black 0, 0, 0 0
Gray 192, 192, 192 12632256
Dark gray 128, 128, 128 8421504
Red 255, 0, 0 255
Dark red 128, 0, 0 128
Yellow 255, 255, 0 65535
Dark yellow 128, 128, 0 32896
Green 0, 255, 0 65280
Dark green 0, 128, 0 32768
Cyan 0, 255, 255 16776960
Dark cyan 0, 128, 128 8421376
Blue 0, 0, 255 16711680
Dark blue 0, 0, 128 8388608
Magenta 255, 0 ,255 16711935
Dark magenta 128, 0, 128 8388736

Remarks

Visual FoxPro uses a red-green-blue (RGB) color scheme for colors. The red, green, and blue components are each represented by a number between 0 and 255. Use the RGB( ) function to convert the three component colors into one composite nColor.