CSDN博客

img bobo1394

美化 MSHFlexGrid,隔行设置颜色的通用函数

发表于2004/1/27 21:07:00  1070人阅读

' 设置MSHFlexGrid每行的颜色
Public Sub SetRowColor(ByRef MSHFlexGrid As Object)
    Dim j, i, objName
    objName = TypeName(MSHFlexGrid)
    If StrConv(Trim(objName), vbUpperCase) <> "MSHFLEXGRID" Then
        Exit Sub
    End If
    MSHFlexGrid.FillStyle = 1
    For i = 1 To MSHFlexGrid.Rows - 1
        MSHFlexGrid.Row = i
        If i Mod 2 = 0 Then
            MSHFlexGrid.Col = 0
            MSHFlexGrid.ColSel = MSHFlexGrid.Cols - 1
            MSHFlexGrid.CellBackColor = &H80FFFF
        End If
    Next i
    MSHFlexGrid.FillStyle = 0
    MSHFlexGrid.Row = 0
    MSHFlexGrid.Col = 0
End Sub
0 0

相关博文

我的热门文章

img
取 消
img