by K. Madhusudhana Rao (2 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 13th September 2001
Date Added: Mon 8th February 2021
Rating:
(1 Votes)
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 :
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
No comments have been posted about This code helps to u : How to get colors alternative rows of Msfelxgrid. Why not be the first to post a comment about This code helps to u : How to get colors alternative rows of Msfelxgrid.