'下面是我用MSHFlexGrid控件编写的。
Private Sub mColor_Click()
For I = 1 To MSHFlexGrid1.Rows - 1
MSHFlexGrid1.Row = I
MSHFlexGrid1.Col = 3
If MSHFlexGrid1.Text > 0 Then
MSHFlexGrid1.CellForeColor = vbRed ' 红色
MSHFlexGrid1.Col = 2
MSHFlexGrid1.CellForeColor = vbRed
ElseIf MSHFlexGrid1.Text < 0 Then
MSHFlexGrid1.CellForeColor = vbGreen ' 绿色
MSHFlexGrid1.Col = 2
MSHFlexGrid1.CellForeColor = vbGreen
End If
Next
End Sub