I had a similar problem (get Enter/Exit events) that I solved with a dirty trick, that works as long as the button is on a form. Otherwise you have to catch the mouse event of the button container.
Code:
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Command1.Tag = "" Then
Debug.Print "Command1_MouseEnter"
Command1.Tag = "1" '' I'm in
'' start date = Now
End If
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Command1.Tag = "1" Then
Command1.Tag = "" '' I'm out
Debug.Print "Command1_MouseExit"
'' total time = total time + (now - start date)
End If
End Sub
I tried to use the SetCapture and ReleaseCapture API, but I had so much trouble that at the end decided for the 'easy' way.
Marco
Bookmarks