Clearing reverse color on a selected row in MSFlexgrid

Posted on 2006-03-30
Last Modified: 2010-04-07
I cannot find a method for clearing the reverse colorization in a msflexgrid on a row that has been selected whenever I want to clear the grid.  I display information in the grid, click the desired row and transfer the information on the row to text boxes for editing.  When completed and the information is saved, I want to use the MSFLEXGRID.CLEAR statement.  This works fine but the last selected row continues to be displayed with the reversed color.  I want the entire row, not just a cell, set back to VBWHITE.

Any ideas?
Question by:jgarner43
    LVL 2

    Expert Comment

    Clear the selection first?

    Author Comment

    How!  I have not seen any methd for clearing a row or setting all cells in a row.
    LVL 9

    Expert Comment

    if u want to set or reset a content in a cell then u can use the following snippet.

    To Reset the cells in a Row

    For i = 0 to MSFlexGrid1.Cols - 1
        MSFlexGrid1.TextMatrix(.Row,i) = ""
    Next i

    To Set the cells in a Row

    MSFlexGrid1.TextMatrix(.Row,0) = TextBox1.Text
    MSFlexGrid1.TextMatrix(.Row,1 = TextBox2Text
    and so on....
    LVL 1

    Accepted Solution

    When You use the MSFLEXGRID.CLEAR statement the backcolor of the cell automatically sets to the default cell backcolor but if it doesn't works for you, try out the following Code

    Private Sub Command1_Click()
    Dim totalRows
    totalRows = MSFlexGrid1.Rows
        For j = 1 To totalRows
            For i = 1 To MSFlexGrid1.Cols - 1
                MSFlexGrid1.Col = i
                MSFlexGrid1.CellBackColor = vbWhite
    End Sub



    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now