BackColor, BackColorBkg, BackColorFixed, BackColorSel Properties Example

The following example uses the BackColorBkg, BackColorFixed, and BackColorSel properties in the MSHFlexGrid. It resets the colors of the control's background, selected background, and fixed-cell background randomly twice each second for the MSHFlexGrid. To use this example, paste the code into the Declarations section of a form with a Timer control and an MSHFlexGrid with the names Timer1 and MSHFlexGrid1 respectively, then load the form.

Note   If you are using the MSFlexGrid, substitute "MSHFlexGrid1" with "MSFlexGrid1."

Private Sub Form_Load ()
   Timer1.Interval =500
End Sub

Private Sub Timer1_Timer ()
   MSHFlexGrid1.BackColorBkg =QBColor(Rnd * 15)
   MSHFlexGrid1.BackColorFixed =QBColor(Rnd * 10)
   MSHFlexGrid1.BackColorSel =QBColor(Rnd * 10)
End Sub