|
-
Mar 28th, 2007, 03:04 PM
#1
Thread Starter
Fanatic Member
mshflexgrid mouseover
Is there a way to highlight a row when I mouseover it?
-
Mar 28th, 2007, 03:19 PM
#2
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
-
Mar 28th, 2007, 03:32 PM
#3
Thread Starter
Fanatic Member
Re: mshflexgrid mouseover
Thanks it works, except for it doesnt highlight my first column.
-
Mar 28th, 2007, 03:58 PM
#4
Thread Starter
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|