title: Move object in a straight line to another point
body: <p>I am struggling to get this right. 
  What I want to do is to move a panel(10px by 10px) to another panel which is the same size.</p>
  
  <p>I want to see how it moves to the other panel... and I achieved this using a timer.</p>
  
  <p>My code works, but I do have a problem I cannot get past...</p>
  
  <p>Most of the time the panel that is moving, first reaches the x or y coordinate and then move in a horizontal or vertical line to the other panel.</p>
  
  <p>This looks OK when moving very fast... but when moving slowly I can see that it looks very wrong.</p>
  
  <p>This is just a small paint job i have created to show you what i have in mind:
  <img src="https://i.stack.imgur.com/3jncB.png" alt="enter image description here"></p>
  
  <p>I want point B to move to point A in a straight line.</p>
  
  <p>CODE:</p>
  
  <pre><code>        private void timer_Tick(object sender, EventArgs e)
          {
              smallX = pnlTo.Location.X;
              smallY = pnlTo.Location.Y;
              largeX = pnlFrom.Location.X;
              largeY = pnlFrom.Location.Y;
  
              //Should we find the ratio??
  
              // ####### X #######
              if (largeX != smallX)
              {
                  int xRatio;
                  if (largeX &gt; smallX)
                  {
                      //If 'large' is to the right.
                      //Find ratio.
                      xRatio = largeX / smallX;
                      pnlFrom.Left -= xRatio;
                  }
                  else
                  {
                      //If 'large' is to the left.
                      //Find ratio.
                      xRatio = smallX / largeX;
                      pnlFrom.Left += xRatio;
                  }
              }
  
              // ####### Y #######
              if (largeY != smallY)
              {
                  int yRatio;
                  if (largeY &gt; smallY)
                  {
                      //If 'large' is to the bottom.
                      yRatio = largeY / smallY;
                      pnlFrom.Top -= yRatio;
  
                      //pnlFrom.Top -= pixelsToMove;
                  }
                  else
                  {
                      //If 'large' is to the top.
                      yRatio = smallY / largeY;
                      pnlFrom.Top += yRatio;
  
                      //pnlFrom.Top += pixelsToMove;
  
                  }
              }
  
              lblLargeX.Text = pnlFrom.Location.X.ToString();
              lblLargeY.Text = pnlFrom.Location.Y.ToString();
  
              if (largeX == smallX &amp;&amp; largeY == smallY)
              {
                  timer.Stop();
              }
          }
  </code></pre>
  
  <p>I know I am very wrong with how to achieve this... but can someone please help me in the right direction? </p>
  
  <p>Thank you in advance.</p>