README.md

December 4, 2022 ยท View on GitHub

Form Drag / Move

Description

This code will make it so you dont have to use the title bar to move your forms/projects.

More Info

Submitted On
ByKevin Still
LevelAdvanced
User Rating3.7 (11 globes from 3 users)
CompatibilityVB 3.0, VB 4.0 (16-bit), VB 4.0 (32-bit), VB 5.0, VB 6.0
CategoryCoding Standards
WorldVisual Basic
Archive File

API Declarations

'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

Source Code

'Put This In Form_MouseDown
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ReleaseCapture
SendMessage Me.hwnd, &H112, &HF012, 0
End Sub