VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Drag form without titlebar

by Kamilche (35 Submissions)
Category: Windows API Call/Explanation
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (7 Votes)

Drag a form that has no titlebar! Add the routine listed below, and call it in the 'MouseDown' event of the form (or a control on the form): MoveWindow Me.Hwnd

API Declarations
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

Rate Drag form without titlebar

Public Sub MoveWindow(TheHwnd As Long)
  'Drag the form with the mouse
  ReleaseCapture
  SendMessage TheHwnd, &HA1, 2, 0&
End Sub

Download this snippet    Add to My Saved Code

Drag form without titlebar Comments

No comments have been posted about Drag form without titlebar. Why not be the first to post a comment about Drag form without titlebar.

Post your comment

Subject:
Message:
0/1000 characters