how do i make it so when the mouse is not on a picturebox anymore, it gives the user a msgbox. i tried using the lostfocus function, but it doesnt seem to do anything.
Printable View
how do i make it so when the mouse is not on a picturebox anymore, it gives the user a msgbox. i tried using the lostfocus function, but it doesnt seem to do anything.
How about the MouseMove event?
that's only when the mouse is still on the picturebox right? i tried that and did msgbox "hello", and it only pops up hello when it's ON it. how do i make it pop "HELLO" once it leaves the picturebox(i want to make a msgbox pop right away when the mouse leaves the picturebox)
VB Code:
Option Explicit Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function GetCapture Lib "user32" () As Long Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If (X < 0) Or (Y < 0) Or (X > Picture1.Width) Or (Y > Picture1.Height) Then ReleaseCapture MsgBox "The mouse is no longer over the picture control" ElseIf GetCapture() <> Picture1.hwnd Then SetCapture Picture1.hwnd 'the mouse is over the picture control 'if you want to do something when this happens 'here is where you would put your code. End If End Sub
thanks so much
Hack!! can u plz explain the function of these 3 functions??VB Code:
Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function ReleaseCapture Lib "user32" () As Long Private Declare Function GetCapture Lib "user32" () As Long
thnx
You can download API Guide, it will explain all API functions.
http://www.mentalis.org/index2.shtml