|
-
Jan 28th, 2009, 12:32 PM
#4
Re: Combox MouseMove Event?
 Originally Posted by RhinoBull
Besides subclassing you can determine whether or not cursor is over combo using timer and few api:
Code:
Option Explicit
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 100 '1/10 of a second
End Sub
Private Sub Timer1_Timer()
'==================================
Dim Rec As RECT, Point As POINTAPI
GetWindowRect Combo1.hwnd, Rec
GetCursorPos Point
If Point.X >= Rec.Left And Point.X <= Rec.Right And Point.Y >= Rec.Top And Point.Y <= Rec.Bottom Then
'MousePointer is over Combobox
Else
'MousePointer is outside Combobox
End If
End Sub
especially since vb6 only lets you have 10 in your project that actually work.
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
|