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.

DisabledItemBackColor, DisabledItemForeColor

These properties control the colors used for disabled items in a list or combo box.

Usage

oObject.DisabledItemBackColor = nBackColor
nBackColor = oObject.DisabledItemBackColor
oObject.DisabledItemForeColor = nForeColor
nForeColor = oObject.DisabledItemForeColor

We’ve come up with only two situations where these properties come into play.

When the RowSourceType for a list or combo is an array or explicit list, you can disable individual items by preceding the text with “\”. So, an array item containing “\Zowie” is disabled in a list or combo.

The only other time an item is disabled is when RowSourceType=7 (Files). In that case, there’s an entry that represents the current directory. It’s disabled. It shows up in these colors. The separator bar that divides the top portion of the file list from the main body uses DisabledItemBackColor, but its ForeColor is black no matter what.

Because the normal dithering makes disabled items look different than enabled items, we suggest you go with the flow and just let these be the same as ItemBackColor and ItemForeColor.

See Also

ComboBox, DisabledBackColor, DisabledForeColor, ItemBackColor, ItemForeColor, ListBox, RowSourceType