If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > MSFlexgrid.backcolor not working. How to color the grid (all rows).

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-30-10, 03:42
LimaCharlie LimaCharlie is offline
Registered User
 
Join Date: Oct 2005
Posts: 119
MSFlexgrid.backcolor not working. How to color the grid (all rows).

I have 2 command buttons. CHECKALL and UNCHECKALL buttons. I'm changing my msglexgrid color to BLUE upon clicking CHECKALL button, and WHITE upon clicking the UNCHECKALL button using backcolor property. Simple, it's working fine.

Upon clicking the grid, "X" will be written on Column 0 of the selected row. It will also highlight the selected row (using cellbackcolor), so the identifier of the rows to be deleted are the "X" mark and the blue colored row.

Now, the backcolor property doesn't work on those columns previously marked/colored. The cellbackcolor is working perfectly but the backcolor is not. What i only want is to color the whole grid (all rows) with blue or white upon clicking CHECKALL & UNCHECKALL button.

Here's my code:
Code:
Private Sub grdCustomers_Click()
Dim intCol As Integer

intCol = 1

If grdCustomers.TextMatrix(grdCustomers.Row, 0) = "X" Then
    grdCustomers.TextMatrix(grdCustomers.Row, 0) = ""
    
    For intCol = 1 To 5
        grdCustomers.Col = intCol
        grdCustomers.CellBackColor = vbWhite
    Next intCol
Else
    grdCustomers.TextMatrix(grdCustomers.Row, 0) = "X"
    
    For intCol = 1 To 5
        grdCustomers.Col = intCol
        grdCustomers.CellBackColor = &HFFFFC0
    Next intCol
    
End If

End Sub
Code:
Private Sub cmdCheckAll_Click()
Dim intRec As Integer

intRec = 1

grdCustomers.FixedCols = 1
grdCustomers.ColAlignment(0) = 1

grdCustomers.BackColor = &HFFFFC0

For intRec = 1 To grdCustomers.Rows - 1
    grdCustomers.TextMatrix(intRec, 0) = "X"
Next intRec

End Sub
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On