Results 1 to 2 of 2

Thread: [RESOLVED] Dragging Windows/Forms Using Their Body

  1. #1

    Thread Starter
    Addicted Member bulletrick's Avatar
    Join Date
    Jul 2005
    Location
    Philippines
    Posts
    248

    Resolved [RESOLVED] Dragging Windows/Forms Using Their Body

    Guys, to drag a window, we need grip the titlebar, right?

    How can I do the same while gripping the body of a form?

    Thanks guys!

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

    Re: Dragging Windows/Forms Using Their Body

    VB Code:
    1. Private Declare Function SendMessage Lib "User32" Alias "SendMessageA" _
    2. (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
    3. lParam As Any) As Long
    4.  
    5. Private Declare Sub ReleaseCapture Lib "User32" ()
    6.  
    7. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    8.     Const WM_NCLBUTTONDOWN = &HA1
    9.     Const HTCAPTION = 2
    10.     If Button = 1 Then
    11.         ReleaseCapture
    12.         SendMessage Me.hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&
    13.     End If
    14. 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