title: Collision detection between two picture boxes not working c# form
body: <p>Hi I'm working on a game that involves two picture boxes, a red box and a blue box. The blue box is controlled by the player and the goal is to collide with the red box, which teleports to a random location every 5 seconds. My problem is getting a collision between the red and blue box. On collision the red box is to teleport to a random location but that isn't happening.</p>
  
  <p>heres my code:  </p>
  
  <pre><code>namespace block_game
  {
      public partial class Form1 : Form
      {
  
          public Form1()
          {
  
              InitializeComponent();
              KeyDown += new KeyEventHandler(Form1_KeyDown);
  
              if (blue_box.Bounds.IntersectsWith(red_box.Bounds))
              {
                  Tele();
              }
  
  
          }
  
          private void Form1_KeyDown(object sender, KeyEventArgs e)
          {
              int x = blue_box.Location.X;
              int y = blue_box.Location.Y;
  
              if (e.KeyCode == Keys.Right) x += 10;
              else if (e.KeyCode == Keys.Left) x -= 10;
              else if (e.KeyCode == Keys.Up) y -= 10;
              else if (e.KeyCode == Keys.Down) y += 10;
  
              blue_box.Location = new Point(x, y);
          }
          public Random r = new Random();
          private void tmrTele_Tick(object sender, EventArgs e)
          {
              tmrTele.Interval = 5000;
              Tele();
          }
  
          private void Tele()
          {
              int x = r.Next(0, 800 - red_box.Width);
              int y = r.Next(0, 500 - red_box.Width);
              red_box.Top = y;
              red_box.Left = x;
          }
  
      }
  }
  </code></pre>