HighLightproperty
Determines whether selected cells appear highlighted within the MSHFlexGrid.
Syntax
PROPERTY Highlight () AS HighLightSettings
PROPERTY Highlight (BYVAL bHighlight AS HighLightSettings)
Parameters
| Name | Description | |
|---|---|---|
bHighlight | flexHighlightNever: There is no highlight on the selected cells. flexHighlightAlways: The selected cells are always highlighted. (Default). flexHighlightWithFocus: The highlight appears only when the control has focus. |
Description
Determines whether selected cells appear highlighted within the MSHFlexGrid.
Remarks
This property controls the visibility of the highlight block (defined by BackColorSel and ForeColorSel).
When this property is set to zero and a range of cells is selected, there is no visual cue or emphasis indicating the selected cells.
Setting Highlight = flexHighlightAlways (1) is a common requirement for dashboard-style applications where the user needs to keep track of a selected record while typing data into a separate sidebar or detail view.
If a cell is merged, the built-in selection highlight may sometimes fail to appear correctly. In these specialized cases, developers often manually use CellBackColor as a fallback for custom highlighting.
While Highlight controls the broad selection colors, the FocusRect property manages the specific dotted or solid box around the single "anchor" cell within that selection.
Example
' Keep the blue selection bar visible at all times grid.Highlight = flexHighlightAlways
' Use with SelectionMode to highlight a whole record grid.SelectionMode = flexSelectionByRow
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid