Is there a way to highlight a row when I mouseover it?
Printable View
Is there a way to highlight a row when I mouseover it?
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
Thanks it works, except for it doesnt highlight my first column.
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?