Advertisement
6_2008-2009 Coding Standards #198561

Borderless Form Drag

To drag a borderless form. Very Easy and Simple. Just a few lines of code.

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Dim DragX As Long, DragY As Long
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
DragX = X: DragY = Y
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Form1.Move Form1.Left + X - DragX, Form1.Top + Y - DragY
End If
End Sub
Original Comments (3)
Recovered from Wayback Machine