FocusRect

Returns or sets a value that determines whether the Grid control should draw a focus rectangle around the current cell.

Syntax

object.FocusRect [= value ]

The FocusRect property syntax has these parts:

Part Description
object An object expression that evaluates to an object.
value Integer or constant that specifies the focus rectangle style, as described in Settings.

Settings

The settings for value are:

Value Description
0 None. No focus rectangle around current cell.
1 Light (default). Light focus rectangle around current cell.
2 Heavy. Heavy focus rectangle around current cell.

Remarks

If a focus rectangle is drawn, then the current cell is painted in the background color, as in most spreadsheets and grids. Otherwise, the current cell is painted in the selection color, so you can see which cell is selected even without the focus rectangle.

For example, the following code sets the focus rectangle for the active cell to a Light Rectangle, using the constant value.

Sub Form1_Load () 
    Grid1.FocusRect = 1
End Sub