为什么这段代码
在Form_Load()中看不到效果,而在click中有效?
Dim i As Integer
Me.Show
With MSHFlexGrid1
.FillStyle = flexFillRepeat
For i = 1 To .Rows - 1
.Row = i: .Col = .FixedCols
.ColSel = .Cols() - .FixedCols
If i Mod 2 = 0 Then
.CellBackColor = &HEDD3D6 ' &H00E8F8FB&
Else
.CellBackColor = &HE0F3F1 ' 兰色
End If
Next i
End With
在Form_Load()中看不到效果,而在click中有效?
Dim i As Integer
Me.Show
With MSHFlexGrid1
.FillStyle = flexFillRepeat
For i = 1 To .Rows - 1
.Row = i: .Col = .FixedCols
.ColSel = .Cols() - .FixedCols
If i Mod 2 = 0 Then
.CellBackColor = &HEDD3D6 ' &H00E8F8FB&
Else
.CellBackColor = &HE0F3F1 ' 兰色
End If
Next i
End With
因为此时数据还没有加载。
另外一些Grid控件,支持直接设定second color,不需要这么做。
放在Form_Actived里面看看。
MSHFlexGrid交替行显示不同颜色 比较好的方法是什么?