Help Center

FocusRectproperty

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

Windowspropertydoc-orphan
No implementation located. This member is documented, but the source scan found no matching declaration. It is likely declared in a header this scan does not resolve, or provided by a macro.

Syntax

PROPERTY FocusRect () AS FocusRectSettings
PROPERTY FocusRect (BYVAL bFocusRect AS FocusRectSettings)

Parameters

NameDescription
bFocusRectflexFocusNone: 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