Freigeben über


HighlightForeColor Property

Specifies the foreground or highlight color of the text in a Grid row when it is selected. A grid's HighlightForeColor property applies only when the grid's HighlightStyle property is set to a value greater than 0. Read/write at design and run time.

Grid.HighlightForeColor [= nColor ]

Parameters

  • nColor
    Numeric data type. HighlightForeColor specifies an integer representing a single color value. Visual FoxPro derives the default color setting from the Windows operating system font color setting for Selected Items. For information about valid color values, see BackColor, ForeColor Properties.

Remarks

In Windows XP, you can find the Selected Items font color setting in the Advanced Appearance dialog box. To open the Advanced Appearance dialog box, right-click the Windows desktop, click Properties. In the Display Properties dialog box, click the Appearance tab, then Advanced, and select Selected Items from the Item list. The operating system font color is specified in the Color box to the right of the Font box.

In Windows 2000, you can set the font color for Selected Items information on the Appearance tab.

Note   Changing the font color for Selected Items changes the setting for all applications.

You can select a color by typing the RGB value in the Properties window property settings box or display the Color dialog box by double-clicking the property in the Properties window properties list. The RGB value for the color you select in the Color dialog box becomes the setting after you close the Color dialog box.

After setting HighlightStyle to a value greater than 0, highlighting remains in effect until HighlightStyle is set to 0. If HighlightStyle is set to a value of 2, only the highlight colors persist. Selected items display only when a grid has focus.

Highlighting affects all cells in a row except the currently selected one, unless the grid's AllowCellSelection property is set to False (.F.), and overrides color property settings such as BackColor and DynamicBackColor settings for any column in the grid.

The following example shows how you can interchange the Windows Selected Items and Selected Items font colors for HighlightForeColor and HighlightBackColor:

tmpColor1 = THIS.GrdCustomer.HighlightBackcolor
tmpColor2 = THIS.GrdCustomer. HighlightForecolor
THIS.GrdCustomer.HighlightBackcolor= tmpColor2
THIS.GrdCustomer.HighlightForecolor=tmpColor1

See Also

Properties | HighlightStyle Property | AllowCellSelection Property | HighlightBackColor Property | ResetToDefault Method | DynamicBackColor, DynamicForeColor Properties | Highlight Property | HighlightRow Property | HighlightStyle Property

Applies To: Grid Control | BROWSE Command