Results 1 to 2 of 2

Thread: [RESOLVED] Moving a form without a titlebar

  1. #1

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Resolved [RESOLVED] Moving a form without a titlebar

    Ok my form is titlebarless but i want the user to be able to click and drag it to whereever on screen.
    i found this in VB6 can anyone convert it or do you have another solution??
    Code:
                Private Declare Function SendMessage Lib "User32" _
    Alias "SendMessageA" (ByVal hWnd As Long, _
    ByVal wMsg As Long, _
    ByVal wParam As Long, _
    ByVal lParam As Any) As Long
    
        Private Declare Sub ReleaseCapture Lib "User32" ()
            Const WM_NCLBUTTONDOWN = &HA1
            Const HTCAPTION = 2
    
    
            'Add this code to the form's MouseMove procedure:
            '
            Dim lngReturnValue As Long
            If Button = 1 Then
                Call ReleaseCapture()
                lngReturnValue = SendMessage(Form1.hWnd, WM_NCLBUTTONDOWN, _
                HTCAPTION, 0&)
            End If

  2. #2

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