Advertisement
ASP_Volume3 Miscellaneous #47084

Drag and Drop anywhere on form

Use this code to drag and drop any control anywhere on a form or another control.

AI

Podsumowanie AI: 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.

Kod źródłowy
original-source
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
Oryginalne komentarze (3)
Odzyskane z Wayback Machine