Results 1 to 3 of 3

Thread: [RESOLVED] msflexgrid row color

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2008
    Posts
    164

    Resolved [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.

  2. #2
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    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.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2008
    Posts
    164

    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
  •  



Click Here to Expand Forum to Full Width