title: how to move a control on mousemove in runtime?
body: <p>I have a WinForm application, I'm trying to move a pictureBox in a Form using <code>MouseMove Event</code>, but i can't figure out what's the right calculation should i do on MouseMove, when i first the pictureBox , its location changes in a senseless way then on moving the pictureBox Location moves correctly.</p>
  
  <p>It's a Panel name <code>OuterPanel</code> which contains the pictureBox <code>picBox</code>, here the code im using :</p>
  
  <pre><code>private void picBox_MouseMove(object sender, MouseEventArgs e)
  {
      if (e.Button == MouseButtons.Left)
      {
          Point p = OuterPanel.PointToClient(MousePosition);
          picBox.Location = this.PointToClient(p);
      }
  }
  </code></pre>
  
  <p>P.S : the goal is moving image after zooming in, like windows photo viewer</p>
  
  <p><img src="https://i.stack.imgur.com/BsqMl.png" alt="enter image description here"></p>
  
  <p><strong>Update</strong> : <code>ConvertFromChildToForm</code> method</p>
  
  <pre><code>private Point ConvertFromChildToForm(int x, int y,Control control)
  {
      Point p = new Point(x, y);
      control.Location = p;
      return p;
  }
  </code></pre>