HI, evryone.
How can i manipulate thr form height and with when mouse is out or in the form?
Thanks.
Printable View
HI, evryone.
How can i manipulate thr form height and with when mouse is out or in the form?
Thanks.
Are you asking how to minimize the form as soon as the mouse is no longer over it?
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.
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