Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

msflexgrid curiosity?

Status
Not open for further replies.

wraygun

Programmer
Dec 9, 2001
272
US
Hi there,

I'm not an everyday programmer. I use vb6 when I need to accomplish a custom task for a client or for myself(in this case). I'm self-taught and probably don't do most things the proper way, but I do get it done (most of the time). I'm stuck on a little issue with a msflexgrid. I don't know if it's possible, or practical, but what I'd like to do is:

While hovering over cells in the flexgrid, highlight the appropriate column and row headers to help the user(me) determine what column/row they are working in. The grid is fairly large. This is more of a visual aid than anything.

Any tips, pointers, ideas, etc. will be greatly appreciated.

Best regards,
Harold

***You can't change your past, but you can change your future***
 
Well, after a little trial and error, I came up with a dirty solution. I'm still curious if anyone can point me in a better direction. But I thought I'd post this for critique if anyone's game.

Best regards,
Harold

Code:
Private Sub MSFlexGrid1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
    
    Static i As Integer
    Static j As Integer
    
    j = j + 1

    If j > 20 Then
  
        For i = 0 To MSFlexGrid1.Rows - 1
            With MSFlexGrid1
                .Row = i
                .Col = 0
                .CellBackColor = &H8000000F
            End With
        Next
     
        With MSFlexGrid1
            .Row = MSFlexGrid1.MouseRow
            .CellBackColor = &HC0C000
        End With
    
        For i = 0 To MSFlexGrid1.Cols - 1
            With MSFlexGrid1
                .Col = i
                .Row = 0
                .CellBackColor = &H8000000F
            End With
        Next
     
        With MSFlexGrid1
            .Col = MSFlexGrid1.MouseCol
            .CellBackColor = &HC0C000
        End With
    
        j = 0
    
    End If

End Sub

***You can't change your past, but you can change your future***
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top