This code helps to u : How to get colors alternative rows of Msfelxgrid
This code helps to u : How to get colors alternative rows of Msfelxgrid
API Declarations
MsFlexgrid1. Go to properties of Msflexgrid and change
property of Fixedcol = 0.
Second create one Module :
Rate This code helps to u : How to get colors alternative rows of Msfelxgrid
(1(1 Vote))
call gridcolor(msflexgrid1)
'in module level paste this code
Public Sub gridcolor(msgrid As MSFlexGrid)
Dim introwcount As Integer
Dim intcolcount As Integer
Dim intcount As Integer
Dim intccount As Integer
Dim intprevrow As Integer
Dim flg As Boolean
With msgrid
introwcount = .Rows
intcolcount = .Cols
End With
'MsgBox introwcount
'MsgBox intcolcount
For intcount = 0 To introwcount - 1
With msgrid
If .Row <> 1 And .Row > 0 Then
If .CellBackColor = 0 Then
intprevrow = .Row - 1
If intprevrow <> 1 Then
.Row = intprevrow
If .CellBackColor = 0 Then
If .Row + 1 <= .Rows - 1 Then
.Row = .Row + 1
flg = True
End If
Else
.Row = intprevrow + 1
End If
ElseIf intprevrow = 1 Then
.Row = .Row
flg = True
End If
If flg = True Then
For intccount = 0 To intcolcount - 1
.CellBackColor = RGB(256, 256, 210)
If .Col < intcolcount - 1 Then
.Col = .Col + 1
End If
Next
.Col = 0
End If
End If
End If
If .Row + 1 <= .Rows - 1 Then
.Row = .Row + 1
flg = False
Else
Exit For
End If
End With
Next
End Sub
This code helps to u : How to get colors alternative rows of Msfelxgrid Comments
No comments yet — be the first to post one!
Post a Comment