-1

I am working on a C# project and i have removed the form border so therefor users cannot drag the program around. I need them to be able to drag by a menu strip or some other toolbox item instead of the form border.

Here is the top of my project:

Enamul Hassan
  • 5,266
  • 23
  • 39
  • 56
  • 1
    Possible duplicate of [Make a borderless form movable?](http://stackoverflow.com/questions/1592876/make-a-borderless-form-movable) or [moving form without title bar](http://stackoverflow.com/questions/23966253/moving-form-without-title-bar) – pinkfloydx33 Oct 09 '16 at 02:52

1 Answers1

0

anywhere click inside form drag....

    private void Form1_MouseMove(object sender, MouseEventArgs e)
    {
        if ((e.Button & MouseButtons.Left) == MouseButtons.Left)
        {
            Location = new Point(this.Left - (mousePoint.X - e.X), this.Top - (mousePoint.Y - e.Y));
        }
    }

    Point mousePoint = new Point(0, 0);

    private void Form1_MouseDown(object sender, MouseEventArgs e)
    {
        mousePoint = new Point(e.X, e.Y);
    }
James
  • 1
  • 1