Visual Basic Programming Code Examples Visual Basic > Forms Code Examples Moving a Form With No Title Bar Moving a Form With No Title Bar 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 Declare Sub ReleaseCapture Lib "User32" () Const WM_NCLBUTTONDOWN = &HA1 Const HTCAPTION = 2 Private Sub Form_MouseMove(Button As Integer, _ Shift As Integer, X As Single, Y As Single) Dim lngReturnValue As Long If Button = 1 Then Call ReleaseCapture lngReturnValue = SendMessage(Form1.hWnd, _ WM_NCLBUTTONDOWN, HTCAPTION, 0&) End If End Sub