Originariamente inviato da pierabo
Ciao, a livello grezzo:
Dim DaSpostare As Boolean
Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
DaSpostare = True
End Sub
Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If DaSpostare Then
Text1.Top = Y
Text1.Left = X
End If
End Sub
Private Sub Text1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
DaSpostare = False
End Sub
oppure + semplicemente
codice:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1.Caption = X
Label2.Caption = Y
Text1.Top = Y
Text1.Left = X
End Sub
Private Sub Text1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1.Top = Y
Text1.Left = X
End Sub