Share via


ForeColor, ForeColorBand, ForeColorFixed, ForeColorHeader, ForeColorSel Properties (ModHFGrid)

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

Returns or sets the colors used to draw text on each part of the ModHFGrid.

Syntax

object.ForeColor [= color]
object.ForeColorBand(BandNumber) [= color]
object.ForeColorFixed [= color]
object.ForeColorHeader(BandNumber) [= color]
object.ForeColorSel [= color]

Syntax for the ForeColor, ForeColorBand, ForeColorFixed, ForeColorHeader, and ForeColorSel properties has these parts:

Part Description
object An object expression that evaluates to the ModHFGrid Control object.
BandNumber Required. A Long value that specifies the band being affected.
color A value or constant that determines the color used to paint text in the scrollable, fixed, band, or header areas of the ModHFGrid.

Remarks

Use the ForeColor property to set the text color of all non-fixed cells.

Use the CellForeColor property to set the text color of individual cells.

Example

The following example sets the ForeColorFixed and the ForeColorSel properties of the ModHFGrid to change to a random color each second.

Private Sub Form_Load ()
   Timer1.Interval = 500
   ModHFGrid1.FillStyle = 2
   ModHFGrid1.Text = "Color Me"
   ModHFGrid1.FixedCols = 1
   ModHFGrid1.FixedRows = 1
End Sub

Private Sub Timer1_Timer ()
   ModHFGrid1.ForeColorFixed = QBColor(Rnd * 15)
   ModHFGrid1.ForeColorSel = QBColor(Rnd * 10)
End Sub

See Also

ModHFGrid Control