This property returns and sets a value that determines whether the Grid control should draw a focus rectangle around the current cell.
object.FocusRect [= value]
Constant |
Value |
Description |
flexFocusNone | 0 | No focus rectangle around current cell |
flexFocusLight | 1 | (Default) Light focus rectangle around current cell |
flexFocusHeavy | 2 | Heavy focus rectangle around current cell |
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.
The following code example shows how to set the focus rectangle for the active cell to a Light Rectangle, using the constant value.
Sub Form1_Load ()
Grid1.FocusRect = flexFocusLight
End Sub