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.

ItemBackColor, ItemForeColor

These properties determine the color of items in a list box or combo box.

Usage

oObject.ItemBackColor = nBackColor
nBackColor = oObject.ItemBackColor
oObject.ItemForeColor = nForeColor
nForeColor = oObject.ItemForeColor

In a combo box, these properties determine colors only for the items in the drop-down part of the combo. The color of the text box part that’s always visible is determined by BackColor and ForeColor (and SelectedBackColor and SelectedForeColor, when some text is highlighted).

For both combos and lists, SelectedItemBackColor and SelectedItemForeColor determine the color of the highlighted item or items.

Example

ThisForm.cboMyCombo.ItemBackColor = RGB(255,0,255)
ThisForm.cboMyCombo.ItemForeColor = RGB(255,255,255)

See Also

BackColor, DisabledItemBackColor, DisabledItemForeColor, ForeColor, SelectedItemBackColor, SelectedItemForeColor