Help Center

ForeColorproperty

Returns or sets the colors used to draw text on 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 ForeColor () AS OLE_COLOR
PROPERTY ForeColor (BYVAL clr AS OLE_COLOR)

Parameters

NameDescription
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 foreground colors of individual cells or cell ranges. This property acts as the global default for all text within the scrollable area of the grid.

Remarks

It affects all data cells simultaneously. It does not affect the text in fixed rows or columns; for those, you must use ForeColorFixed.

While ForeColor is the general default, in hierarchical views you can override text colors for specific data levels using the ForeColorBand(BandNumber) property.

To change the text color of a single specific cell, use the CellForeColor property after setting the Row and Col properties to target that cell.

Example

' Sets the global text color for all data cells grid.ForeColor = BGR(0, 0, 102)

' Contrast with the header text color grid.ForeColorFixed = vbWhite

Reference