Jump to content

Move form on click and drag


Recommended Posts

anyone have an idea how to move a form when u click and drag it? i tryed google couldnt think anythink to put and came up with all the wrong stuff

atm i got

      
   Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
       Me.Location = New Point(Control.MousePosition.X - 100, Control.MousePosition.Y - 100)

   End Sub

it just moves the form once i was thinking of changing the 100

(Me.Location = New Point(Control.MousePosition.X - 100, Control.MousePosition.Y - 100) to the mouse position on the form but wasnt sure how to do that any ideas how to do that also?

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...