Logo

Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.

ColorScheme

This control property is provided mostly to aid in converting screens where the objects have color schemes assigned to them. It works only sporadically.

Usage

oObject.ColorScheme = nColorScheme
nColorScheme = oObject.ColorScheme

The old FoxPro/DOS coloring system includes 24 color schemes in each color set. Each scheme is meant to handle a different aspect of the interface. For details on this, see CREATE COLOR SET.

This property, together with ColorSource, is meant to let you apply those color schemes to controls in your forms. But it works only when it feels like it. First, you have to set ColorSource to 2 before FoxPro pays any attention at all to ColorScheme—that’s documented. (In VFP 6 and later, only the ColorSource Help has this information; the ColorScheme help says, in essence, “don’t do that.”)

Not only that, but if BackColor or ForeColor is changed for the object, it totally ignores the ColorScheme you’ve set and uses those colors.

We suggest you stay away from this property except in converted 2.x screen sets.

Example

This.ColorScheme = 3

See Also

BackColor, ColorSource, Create Color Set, ForeColor