|
-
Sep 20th, 2000, 02:26 AM
#1
Thread Starter
Addicted Member
How do I make it so when the mouse goes over an Image code is activated? I tried MouseMove, but that only works when you move the mouse over something - I need it so if a mouse is on an Image it activates the code, whether it's moving or not.
Thanks.
-Git
-
Sep 20th, 2000, 02:56 AM
#2
-
Sep 20th, 2000, 10:15 PM
#3
Lively Member
Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Type PointAPI
X as Long
Y as Long
End Type
Private lLeft as long, lTop as Long,
Private MyPoints as PointAPI
Form_Load
lLeft = Picture1.Left + Form1.Left
lTop = Picture1.top + Form1.Top
end sub
Private Sub Picture1_MouseMove(...)
Timer1.Enabled = True
Timer2.Enabled = True
End Sub
Private Sub Timer1_Timer()
'Your code here
End Sub
Private Sub Timer2_Timer()
GetMouseXY MyPoints
'See if the Cursor is still over the picture
If (MyPoints.X < lLeft) OR (MyPoints.X > (lLeft + Picture1.Width)) OR (MyPoints.Y < lTop OR MyPoints.Y > (lTop + Picture1.Height)) Then
Timer1.Enabled = False
Timer2.Enabled = False
'Basicly, This checks every side of the Picturebox and makes sure the mouse is still on the inside of the box
End Sub
I think this will work, Let me know if you have any problems
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
|