Results 1 to 3 of 3

Thread: [RESOLVED] flexgrid forecolor

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2004
    Location
    Turkey, Eskisehir
    Posts
    37

    Resolved [RESOLVED] flexgrid forecolor

    I know, too much simple question I ask. I hope not disturbing anyone, I want to end my first serious project and there are too much obstacle for an amateur programmer.
    --------------------------------------------------------------------------
    1- one flex with 40 row, 15 col.
    2- 6 cmd_button and each linked to a different database.
    2a- when I click first button, the first database will load into the flex. second button, second database ....
    --------------------------------------------------------------------------
    3- dbl click event on the flex will change the fore color of the 1st col of the row.

    4- problem: in first scene, say, I double clicked the 4th row, ok, it changes the forecolor of the 1st col of the 4th row to blue, then, when I passed the second scene (second button) but the 4th row forecolor still remains blue.

    5- I tried to solve this using a loop on each clicking of the buttons: (because I don't know any easy way)

    Code:
    .col=1
    for i=1 to .rows-1
    cellsforecolor=qbcolor(0)
    next
    but It slows the loading down very much.

    in this condition, for not slowing what should I do ?

    Have a nice day...

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

    Re: flexgrid forecolor

    Add this Sub to your Form, call it inside your CommandButton's Click event:
    Code:
    Private Sub ResetSelection()
        With MSFlexGrid1 'Add your Flex name instead of this here
            .Redraw = False
            
            'This will ensure that complete Selection is affected
            .FillStyle = flexFillRepeat
            
            'Make a Selection (First column)
            .Row = .FixedRows
            .Col = .FixedCols
            .RowSel = .Rows - 1
            .ColSel = .Col
            
            'Assign Flex Backcolor
            .CellBackColor = .BackColor
            
            'Remove Selection
            .Col = .FixedCols
            
            'Back to Single Fill 
            .FillStyle = flexFillSingle
            
            .Redraw = True
        End With
    End Sub

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2004
    Location
    Turkey, Eskisehir
    Posts
    37

    Re: flexgrid forecolor

    sorry for I am late,
    I just try your code and it works very well,
    there is no slow down.
    thank you very much.
    have a nice day...

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