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.

DisabledBackColor, DisabledForeColor

These properties determine the appearance of a control when it’s disabled (that is, when its Enabled property is .F.).

Usage

oObject.DisabledBackColor = nColor
nColor = oObject.DisabledBackColor
oObject.DisabledForeColor = nColor
nColor = oObject.DisabledForeColor

The docs say both disabled forecolors and backcolors colors are dithered with gray, but as far as we can tell, this doesn’t apply at all to backcolors and applies to forecolors only for some controls.

Example

* match an object's disabled colors to its regular colors
* with the dithering of the forecolor, this should result
* in the back remaining the same and the lettering dimming
* for those controls so affected.
This.DisabledBackColor = This.BackColor
This.DisabledForeColor = This.ForeColor

See Also

BackColor, DisabledItemBackColor, DisabledItemForeColor, ForeColor, GetColor(), RGB()