Public Sub SetMSHFlexGridColColor(ByRef grdSet As MSHFlexGrid, ByVal intCol As Integer, _ Optional ByVal lngFColor As Long = vbBlack, Optional ByVal lngBColor As Long = vbWhite, _ Optional ByVal lngBackColor As Long = vbWhite) Dim i As Long
With grdSet .BackColor = lngBackColor For i = 1 To .Rows - 1 .Row = i .Col = intCol .CellForeColor = lngFColor .CellBackColor = lngBColor Next i End With End Sub'ÉèÖÃMSHFlexGridÿÐеÄÑÕÉ« Public Sub SetMSHFlexGridRowColor(ByRef grdSet As MSHFlexGrid, ByRef lngBColor As Long) Dim j As Long Dim i As Long Dim strObjectName As String
strObjectName = TypeName(grdSet) If StrConv(Trim(strObjectName), vbUpperCase) <> UCase("MSHFlexGrid") Then Exit Sub End If grdSet.FillStyle = flexFillRepeat For i = 1 To grdSet.Rows - 1 grdSet.Row = i If i Mod 2 = 0 Then grdSet.Col = 1 grdSet.ColSel = grdSet.Cols - 1 grdSet.CellBackColor = lngBColor End If Next i grdSet.FillStyle = 0 grdSet.Row = 0 grdSet.Col = 0 End Sub
’设置某列 Public Sub SetMSHFlexGridColColor(ByRef grdSet As MSHFlexGrid, ByVal intCol As Integer, _ Optional ByVal lngFColor As Long = vbBlack, Optional ByVal lngBColor As Long = vbWhite, _ Optional ByVal lngBackColor As Long = vbWhite) Dim i As Long
With grdSet .BackColor = lngBackColor For i = 1 To .Rows - 1 .Row = i .Col = intCol .CellForeColor = lngFColor .CellBackColor = lngBColor Next i End With End Sub'MSHFlexGrid Public Sub SetMSHFlexGridRowColor(ByRef grdSet As MSHFlexGrid, ByRef lngBColor As Long) Dim j As Long Dim i As Long Dim strObjectName As String
strObjectName = TypeName(grdSet) If StrConv(Trim(strObjectName), vbUpperCase) <> UCase("MSHFlexGrid") Then Exit Sub End If grdSet.FillStyle = flexFillRepeat For i = 1 To grdSet.Rows - 1 grdSet.Row = i If i Mod 2 = 0 Then grdSet.Col = 1 grdSet.ColSel = grdSet.Cols - 1 grdSet.CellBackColor = lngBColor End If Next i grdSet.FillStyle = 0 grdSet.Row = 0 grdSet.Col = 0 End Sub
Optional ByVal lngFColor As Long = vbBlack, Optional ByVal lngBColor As Long = vbWhite, _
Optional ByVal lngBackColor As Long = vbWhite)
Dim i As Long
With grdSet
.BackColor = lngBackColor
For i = 1 To .Rows - 1
.Row = i
.Col = intCol
.CellForeColor = lngFColor
.CellBackColor = lngBColor
Next i
End With
End Sub'ÉèÖÃMSHFlexGridÿÐеÄÑÕÉ«
Public Sub SetMSHFlexGridRowColor(ByRef grdSet As MSHFlexGrid, ByRef lngBColor As Long)
Dim j As Long
Dim i As Long
Dim strObjectName As String
strObjectName = TypeName(grdSet)
If StrConv(Trim(strObjectName), vbUpperCase) <> UCase("MSHFlexGrid") Then
Exit Sub
End If
grdSet.FillStyle = flexFillRepeat
For i = 1 To grdSet.Rows - 1
grdSet.Row = i
If i Mod 2 = 0 Then
grdSet.Col = 1
grdSet.ColSel = grdSet.Cols - 1
grdSet.CellBackColor = lngBColor
End If
Next i
grdSet.FillStyle = 0
grdSet.Row = 0
grdSet.Col = 0
End Sub
Public Sub SetMSHFlexGridColColor(ByRef grdSet As MSHFlexGrid, ByVal intCol As Integer, _
Optional ByVal lngFColor As Long = vbBlack, Optional ByVal lngBColor As Long = vbWhite, _
Optional ByVal lngBackColor As Long = vbWhite)
Dim i As Long
With grdSet
.BackColor = lngBackColor
For i = 1 To .Rows - 1
.Row = i
.Col = intCol
.CellForeColor = lngFColor
.CellBackColor = lngBColor
Next i
End With
End Sub'MSHFlexGrid
Public Sub SetMSHFlexGridRowColor(ByRef grdSet As MSHFlexGrid, ByRef lngBColor As Long)
Dim j As Long
Dim i As Long
Dim strObjectName As String
strObjectName = TypeName(grdSet)
If StrConv(Trim(strObjectName), vbUpperCase) <> UCase("MSHFlexGrid") Then
Exit Sub
End If
grdSet.FillStyle = flexFillRepeat
For i = 1 To grdSet.Rows - 1
grdSet.Row = i
If i Mod 2 = 0 Then
grdSet.Col = 1
grdSet.ColSel = grdSet.Cols - 1
grdSet.CellBackColor = lngBColor
End If
Next i
grdSet.FillStyle = 0
grdSet.Row = 0
grdSet.Col = 0
End Sub