Drag and Drop anywhere on form
Use this code to drag and drop any control anywhere on a form or another control.
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
Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) X1 = X Y1 = Y End Sub Private Sub Form_DragDrop(Source As Control, X As Single, Y As Single) Source.Top = Y - Y1 Source.Left = X - X1 End Sub Private Sub Label1_DragDrop(Source As Control, X As Single, Y As Single) Source.Top = Label1.Top + Y - Y1 Source.Left = Label1.Left + X - X1 End Sub Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) X1 = X Y1 = Y End Sub
Original Comments (3)
Recovered from Wayback Machine