[help]How could my drag code be smoother?
ok this is my full drag code
Code:
Private Sub Button2_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button2.MouseDown
Xpos = Cursor.Position.X - Button2.Location.X
Ypos = Cursor.Position.Y - Button2.Location.Y
End Sub
Private Sub Button2_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button2.MouseMove
If e.Button = Windows.Forms.MouseButtons.Left Then
Pos = MousePosition
Pos.X = Pos.X - Xpos
Pos.Y = Pos.Y - Ypos
Button2.Location = Pos
My.Settings.ff = Button2.Location
My.Settings.Save()
End If
End Sub
how would i make it smoother? as in dragging wise less laggy i was think on making it save only when u let go but rember it's a button i dont want it to save every time i click it. only when i'm done dragging.