Help Center

ForeColorBandproperty

Returns or sets the colors used to draw text on the band part of the MSHFlexGrid.

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 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

NameDescription
BandNumberA zero‑based index identifying the band whose background color is being retrieved or modified. If the band number is omited, band 0 is assumed.
clrAn 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