|
-
Apr 21st, 2009, 10:58 PM
#1
Thread Starter
Addicted Member
[RESOLVED] msflexgrid row color
hi all, how do you color the last row of msflexgrid? i have done a code which copies from one flexgrid to another, but my question is, how do you know that the one that you are coloring is the last 4 rows?
this is my code, copy a data to another flexgrid, but i want to color the last 4 rows.
Code:
Dim iRow As Integer
For iRow = 1 To MSFlexGrid1.Rows - 1
With MSFlexGrid2
.AddItem .Rows
.TextMatrix(.Rows - 1, 0) = MSFlexGrid1.TextMatrix(iRow, 0)
.TextMatrix(.Rows - 1, 1) = MSFlexGrid1.TextMatrix(iRow, 1)
.TextMatrix(.Rows - 1, 2) = MSFlexGrid1.TextMatrix(iRow, 2)
.TextMatrix(.Rows - 1, 3) = MSFlexGrid1.TextMatrix(iRow, 3)
.TextMatrix(.Rows - 1, 4) = MSFlexGrid1.TextMatrix(iRow, 4)
.TextMatrix(.Rows - 1, 5) = MSFlexGrid1.TextMatrix(iRow, 5)
.TextMatrix(.Rows - 1, 6) = MSFlexGrid1.TextMatrix(iRow, 6)
.TextMatrix(.Rows - 1, 7) = MSFlexGrid1.TextMatrix(iRow, 7)
End With
Next
thanks for your help.
-
Apr 21st, 2009, 11:16 PM
#2
Re: msflexgrid row color
Code:
With MSFlexGrid2
.FillStyle = flexFillRepeat ' Using this the Format will affect the selection between
' .Row to .RowSel and .Col to .Colsel
.Redraw = False ' Stop redrawing event (no flickering)
.Row = .Rows - 5 ' .Rows - 1 is the last row, so we start at -5
.Col = .FixedCols ' First not fixed col
.RowSel = .Rows - 1 ' Last row
.ColSel = .Cols - 1 ' Last col
.CellBackColor = RGB(210, 55, 55) ' Some Red
.CellForeColor = RGB(22, 22, 120) ' Some Blue
.Redraw = True ' Allow redrawing again
.FillStyle = flexFillSingle ' Retore single formating
.Col = 0: .Row = 0 ' This removes the selection
End With
Last edited by jcis; Apr 21st, 2009 at 11:19 PM.
-
Apr 21st, 2009, 11:45 PM
#3
Thread Starter
Addicted Member
Re: msflexgrid row color
tnx for the reply jcis, i really appreciate it!
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
|