注册 登录
编程论坛 VB6论坛

MSFlexGrid控件

醒来的羔羊 发布于 2015-10-26 23:57, 552 次点击
>怎样来实现MSFlexGrid控件单数行背景为白色,双数的行背景为蓝色?
Dim i As Integer
With MSFlexGrid1
.AllowBigSelection = True ’ 设置网格样式
.FillStyle = flexFillRepeat
For i = 0 To .Rows - 1
.Row = i
.Col = .FixedCols
.ColSel = .Cols() - .FixedCols - 1
If i Mod 2 = 0 Then
.CellBackColor = &HC0C0C0 ’ 浅灰
Else
.CellBackColor = vbBlue ’ 兰色
End If
Next i
End With



.Row = i   
.Col = .FixedCols
.ColSel = .Cols() - .FixedCols - 1
其中这三语句是什么意思啊   没看懂啊   求注释
1 回复
#2
yxf1272015-11-03 17:02
.Row = i    ''''选择要操作的行
.Col = .FixedCols    ''''找到表中固定列的数目
.ColSel = .Cols() - .FixedCols - 1    ''''计算出需要改变颜色的列,也就是说固定列不变色
1