Enter this code in a BAS module to let users move a window without a title bar:
Declare Function ReleaseCapture Lib "user32" () As LongDeclare Function SendMessage Lib "user32" _ Alias "SendMessageA" ( _ ByVal hwnd As Long, ByVal wMsg As Long, _ ByVal wParam As Long, lParam As Any) As LongPublic Const HTCAPTION = 2Public Const WM_NCLBUTTONDOWN = &HA1
To give users a way to begin the move, place a little colored PictureBox in one corner of the form and let its MouseDown event begin the process:
Private Sub Picture1_MouseDown(Button As _ Integer, Shift As Integer, X As Single, Y As Single) ReleaseCapture SendMessage hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0&End Sub
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.























