title: Checking if panels contain something
body: <pre><code>private void PBoxJigsaw1_MouseUp(object sender, MouseEventArgs e)
      {
          if (sender != null &amp;&amp; sender.GetType() == typeof(PictureBox))
          {
              if (e.Button == System.Windows.Forms.MouseButtons.Left)
              {
                  PictureBox answer = (PictureBox)sender;
  
                  if (answer.Location.X &lt; pnlJigsaw5.Location.X &amp;&amp; answer.Location.Y &gt; pnlJigsaw5.Location.Y)
                  {
                      if (answer.Location.X + answer.Width &gt; pnlJigsaw5.Location.X)
                      {
                          if ((answer.Location.X + answer.Width) &lt; pnlJigsaw5.Location.X + pnlJigsaw5.Width)
                          {
                              answer.Location = pnlJigsaw5.Location;
                          }
                      }
                  }
                  else if (answer.Location.X &lt; pnlJigsaw1.Location.X &amp;&amp; answer.Location.Y &gt; pnlJigsaw1.Location.Y)
                  {
                      if (answer.Location.X + answer.Width &gt; pnlJigsaw1.Location.X)
                      {
                          if ((answer.Location.X + answer.Width) &lt; pnlJigsaw1.Location.X + pnlJigsaw1.Width)
                          {
                              answer.Location = pnlJigsaw1.Location;
                          }
                      }
                  }
  </code></pre>
  
  <p>I have created a jigsaw on c# where the user drags pictureBoxs into panels to create an image. I was wondering if it is possible to check if a panel contains something as at the minute numerous pictureBoxs can go into one panel and it can seem like they disappear, although they are just going behind each other. I am just wanting to make it that only only one pictureBox can be in a panel at one time. Thanks</p>