Results 1 to 4 of 4

Thread: mshflexgrid mouseover

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    779

    mshflexgrid mouseover

    Is there a way to highlight a row when I mouseover it?

  2. #2
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: mshflexgrid mouseover

    Depends on what you mean by "highlight a row". To the FlexGrid highlighting means the Row is the current row or is in the range of selected rows.

    The following simply changes the current row, thus highlighting the row the mouse is over.

    Code:
    Private Sub Form_Load()
        Me.MSHFlexGrid1.Rows = 10
        Me.MSHFlexGrid1.Cols = 5
    End Sub
    
    Private Sub MSHFlexGrid1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
        With Me.MSHFlexGrid1
            If .Row <> .MouseRow Then
                .Row = .MouseRow
                .Col = .FixedCols
                .ColSel = .Cols - 1
            End If
        End With
    End Sub

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    779

    Re: mshflexgrid mouseover

    Thanks it works, except for it doesnt highlight my first column.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    779

    Re: mshflexgrid mouseover

    ok. i fixed it

    With MSHFlexGrid2
    If .MouseRow <> 0 And .MouseRow <> .Rows - 1 Then
    If .Row <> .MouseRow Then
    .Row = .MouseRow
    .Col = 0
    .ColSel = .Cols - 1
    End If
    End If
    End With

    but now, how do i unhighlight all rows when the mouse leaves the grid?

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