This is Visual Basic 6.0 code.
Dim cx, cy, dx, dy As Single
Dim bDrag As Boolean
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
bDrag = True : dx = X : dy = Y : cx = Me.Left : cy = Me.Top
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If bDrag Then
cx = cx + X - dx : cy = cy + Y - dy
Me.Move(cx, cy)
End If
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
bDrag = False
End Sub
Can anyone translate it to Visual Basic.Net, please?