Create GetMouseFocus / LostMouseFocus in yours controls (new version)
Create GetMouseFocus / LostMouseFocus in yours controls (new version)
API Declarations
Public Declare Function ReleaseCapture Lib "user32" () As Long
Rate Create GetMouseFocus / LostMouseFocus in yours controls (new version)
(2(2 Vote))
'form with the name Command1
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static CtrMov As Boolean
With Command1 'Change this 'Command1' to your control name
If (X < 0) Or (Y < 0) Or (X > .Width) Or (Y > .Height) Then
ReleaseCapture
CtrMov = False
'Put here your code to LostMouseFocus
'For example:
Me.Print "LostMouseFocus"
Else
SetCapture .hwnd
If CtrMov = False Then
CtrMov = True
'Put here your code to GetMouseFocus
'For example:
Me.Print "GetMouseFocus"
End If
End If
End With
End Sub
Create GetMouseFocus / LostMouseFocus in yours controls (new version) Comments
No comments yet — be the first to post one!
Post a Comment