Results 1 to 3 of 3

Thread: Making form move with mouse click

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517
    Cloud some one help me out..

    I need a form to move with the cursor
    when the back of the form is clicked.. and then
    stop following the cursor when the
    mouse is released..

    I cant figure it out.. thanks!

  2. #2
    Guest
    Code:
    Private Declare Function ReleaseCapture Lib "user32" () As Long
    Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
    
    Private Sub FormDrag(frm As Form)
    
      ReleaseCapture
      Call SendMessage(frm.hwnd, 161, 2, 0&)
    
    End Sub
    
    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    
      FormDrag(Me)
    
    End Sub

  3. #3
    Hyperactive Member Asaf_99's Avatar
    Join Date
    Jul 2000
    Location
    Israel
    Posts
    335

    Weeeeeeee!

    This code is cool!
    Try using it for command buttons and other stuff!
    Asaf Sagi

    ICQ: 61917199
    E-Mail: [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
  •  



Click Here to Expand Forum to Full Width