FocusRectproperty
Returns or sets a value that determines whether the MSHFlexGrid should draw a focus rectangle around the current cell.
Syntax
PROPERTY FocusRect () AS FocusRectSettings
PROPERTY FocusRect (BYVAL bFocusRect AS FocusRectSettings)
Parameters
| Name | Description | |
|---|---|---|
bFocusRect | flexFocusNone: No focus rectangle is displayed. The active cell is indistinguishable from others unless background/selection colors are used. flexFocusLight: A light, dotted line rectangle appears around the active cell. flexFocusHeavy:A thick, solid black rectangle appears around the active cell. |
Description
Returns or sets a value that determines whether the MSHFlexGrid should draw a focus rectangle around the current cell.
Remarks
The FocusRect is distinct from the BackColorSel (selection highlight). The focus rectangle identifies the single "anchor" cell within a larger selected block of cells.
Developers often set FocusRect = flexFocusNone when building modern dashboard-style interfaces where a dotted line appears "dated." Instead, they rely on the `BackColorSel to show focus.
The flexFocusHeavy (2) setting is particularly useful for accessibility on modern high-resolution displays, where the light dotted line can be difficult for users to see.
Example
' Removes the focus rectangle from the active cell hrid.FocusRect = flexFocusNone
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid