|
-
Aug 3rd, 2006, 08:41 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] minimize form when mouse it´s out of the form?
HI, evryone.
How can i manipulate thr form height and with when mouse is out or in the form?
Thanks.
-
Aug 3rd, 2006, 09:29 AM
#2
Re: minimize form when mouse it´s out of the form?
Are you asking how to minimize the form as soon as the mouse is no longer over it?
-
Aug 3rd, 2006, 09:40 AM
#3
Thread Starter
Hyperactive Member
Re: minimize form when mouse it´s out of the form?
I hack
No what i want to do is this.
When the mouse it´s out of the form, the form size is decreased.
And when the mouse it´s in the form i want to put is size back to the original size.
-
Aug 3rd, 2006, 09:44 AM
#4
Re: minimize form when mouse it´s out of the form?
Play with the numbers until you get what you want.
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 Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If (X < 0) Or (Y < 0) Or (X > Form1.Width) Or (Y > Form1.Height) Then
ReleaseCapture
'reduce size cause the mouse is no longer over the form
Me.Height = 1000
Me.Width = 1500
ElseIf GetCapture() <> Form1.hwnd Then
SetCapture Form1.hwnd
'restore size cause the mouse is back over the form.
Me.Height = 3600
Me.Width = 4800
End If
End Sub
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
|