|
-
November 11th, 1999, 10:55 PM
#1
If mouse moves off the form then form becomes invisible
-
November 11th, 1999, 11:20 PM
#2
Re: If mouse moves off the form then form becomes invisible
Try this:
Add a Timer Control to a Form..
private Type POINTAPI
x as Long
y as Long
End Type
private Declare Function GetCursorPos Lib "user32" (lpPoint as POINTAPI) as Long
private Sub Form_Activate()
Timer1.Enabled = true
End Sub
private Sub Form_Load()
Timer1.Interval = 100
End Sub
private Sub Timer1_Timer()
Dim tPA as POINTAPI
Call GetCursorPos(tPA)
If tPA.x < ScaleX(Left, vbTwips, vbPixels) Or tPA.x > ScaleX(Left + Width, vbTwips, vbPixels) Or tPA.y < ScaleY(Top, vbTwips, vbPixels) Or tPA.y > ScaleY(Top + Height, vbTwips, vbPixels) then
Timer1.Enabled = false
Hide
End If
End Sub
Aaron Young
Analyst Programmer
[email protected]
[email protected]
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
|