I already got the move part, that's easy, what I'm having trouble with is when I click on the form and try to move it, it shifts a little, that is really annoying, I just want it to be smooth. I want it to be as if I'm moving the form from the title bar. Here's my code.
vb Code:
Public Class Form1 Dim Down As Boolean = False Dim Local1 As Point Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown Down = True Local1 = e.Location End Sub Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove If Down = True Then Me.Location = MousePosition - Local1 End If End Sub Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp Down = False End Sub End Class




Reply With Quote