Partager via


HighlightStyle Property

Specifies whether the selected row in a Grid remains highlighted when changing the focus to another control in the form. Read/write at design and run time.

HighlightStyle works with the HighlightForeColor and HighlightBackColor properties in determining whether the selected row is highlighted, and whether it remains highlighted when you press the TAB key to move around in the grid, or when you click outside the grid to move focus to another control.

Grid.HighlightStyle [ = nValue ]

Parameters

  • nValue
    Numerical data type. The following table describes the settings for nValue.
    nValue  
    0 No color highlighting for grid row (Default)
    1 Enable highlighting for current row.
    2 Enable highlighting for current row and persist when grid is not the current active control.

Remarks

If HighlightStyle contains a value greater than 0, the default color of HighlightBackColor appears as a 50% lighter gradient fill.

If HighlightStyle is set to a value of 2, only the highlight colors persist. Selected items display only when a grid has focus.

If a column's Sparse property is set to False (.F.), the column will not be highlighted, when the grid's HighlightStyle property is set to 1 or 2.

See Also

Properties | HighlightForeColor Property | Highlight Property | HighlightBackColor Property | HighlightRow Property

Applies To: Grid Control