Results 1 to 4 of 4

Thread: [RESOLVED] minimize form when mouse it´s out of the form?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    292

    Resolved [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.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    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?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    292

    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.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: minimize form when mouse it´s out of the form?

    Play with the numbers until you get what you want.
    VB Code:
    1. Option Explicit
    2.  
    3. Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
    4. Private Declare Function ReleaseCapture Lib "user32" () As Long
    5. Private Declare Function GetCapture Lib "user32" () As Long
    6.  
    7. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    8. If (X < 0) Or (Y < 0) Or (X > Form1.Width) Or (Y > Form1.Height) Then
    9.        ReleaseCapture
    10.        'reduce size cause the mouse is no longer over the form
    11.        Me.Height = 1000
    12.        Me.Width = 1500
    13. ElseIf GetCapture() <> Form1.hwnd Then
    14.        SetCapture Form1.hwnd
    15.        'restore size cause the mouse is back over the form.
    16.        Me.Height = 3600
    17.        Me.Width = 4800
    18. End If
    19. 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
  •  



Click Here to Expand Forum to Full Width