title: Getting mouse position according to form in c#
body: <p>I am devoloping app in Visual Studio using C#.
  I set no border in my form and I want to make my form dragable.</p>
  
  <p><a href="https://i.stack.imgur.com/6Y4tv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6Y4tv.png" alt="enter image description here"></a></p>
  
  <p><strong>I need to get position of mouse according to form to get my code work</strong></p>
  
  <p><a href="https://i.stack.imgur.com/qeuOp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qeuOp.png" alt="enter image description here"></a></p>
  
  <p>This is my code to make it dragable</p>
  
  <pre><code>private void timer1_Tick(object sender, EventArgs e)
  {
      //HERE CODE SET POSITION OF MY FORM
      this.Location = new Point(MousePosition.X - MOUSE POSITION ACCORDING TO FORM, MousePosition.Y - MOUSE POSITION ACCORDING TO FORM);
  }
  
  private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
  {
      timer1.Enabled = true;
  }
  
  private void pictureBox1_MouseUp(object sender, MouseEventArgs e)
  {
      timer1.Enabled = false;
  }
  </code></pre>
  
  <p>Your answers will be appreciated.</p>