|
-
December 13th, 1999, 01:01 PM
#1
Grid and BackColor Change
Can someone provide me with any tips where in I can change the BackColor of a row in a grid. As an example if there are ten rows displayed, I would like to see two different colors in backcolor alternating.
Thanks a million.
-
December 16th, 1999, 08:38 AM
#2
Re: Grid and BackColor Change
If you're using the FlexGrid, you can use code such as :
private Sub ColorBackGrid()
Dim lCount as Long
With MSFlexGrid1
.Redraw = false
.FillStyle = flexFillRepeat
for lCount = .FixedRows to .Rows - 1
.Col = .FixedCols
.Row = lCount
.RowSel = .Row
.ColSel = .Cols - 1
If .Row Mod 2 = 0 then
.CellBackColor = vbBlue
else
.CellBackColor = vbYellow
End If
next
.FillStyle = flexFillSingle
.Redraw = true
End With
End Sub
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|