ForeColorBandproperty
Returns or sets the colors used to draw text on the band part of the MSHFlexGrid.
Syntax
PROPERTY ForeColorBand (BYVAL BandNumber AS LONG) AS OLE_COLOR
PROPERTY ForeColorBand (BYVAL BandNumber AS LONG, BYVAL clr AS OLE_COLOR)
PROPERTY ForeColorBand () AS OLE_COLOR
PROPERTY ForeColorBand (BYVAL clr AS OLE_COLOR)
Parameters
| Name | Description | |
|---|---|---|
BandNumber | A zero‑based index identifying the band whose background color is being retrieved or modified. If the band number is omited, band 0 is assumed. | |
clr | An OLE_COLOR value, such as a Visual Basic constant (e.g. vbBlue), a hex code, or an RGB value. |
Description
Returns or sets the text color for for the data cells within a specific band (level) of a hierarchical display.
Remarks
Like other band-specific properties, ForeColorBand is an array property that allows you to apply different text colors to different levels of nested data.
The primary use of ForeColorBand is to create visual distinction between data levels in a hierarchical grid. For example: Top-level data (Band 0): Can be set to a bold black for high visibility. Nested data (Band 1 or higher): Can be set to a softer color, like dark gray or blue, to indicate it is secondary or sub-detail information.
ForeColorBand overrides the global ForeColor setting for all cells within that specific band. However, the CellForeColor property can still be used to override an individual cell's color within that band.
This property specifically targets data cells. To change the text color of the headers for a specific band, use the ForeColorHeader property instead.
Example
' Setting text color for the parent level grid.ForeColorBand(0) = vbBlack
' Setting text color for the child level grid.ForeColorBand(1) = RGB(150, 0, 0)
Reference
- Documented in Windows/Windows GUI/MSHFlexGrid Class.md
- Topic: Microsoft Hierarchical Grid