title: If picturebox.image == Properties.Resources.ImageA
body: <p>Im making few buttons(picturebox) that then you click them they change image.</p>
  
  <p>I tryed this code but it always skips to else.</p>
  
  <p>Images are loaded from resources. </p>
  
  <pre><code>private void pictureBox7_Click(object sender, EventArgs e)
      {
         if (pictureBox7.Image == KaminuSkaiciuokle.Properties.Resources.IcopalA)
         {
             pictureBox7.Image = KaminuSkaiciuokle.Properties.Resources.IcopalB;
         }
         else
         {
              pictureBox7.Image = KaminuSkaiciuokle.Properties.Resources.IcopalA;
         }
      }
  </code></pre>
  
  <p>Figured that out.</p>
  
  <p>Insted comparing picturebox.image I set picturebox.tag and compare.</p>
  
  <pre><code>pictureBox7.Tag = "B";
  if (pictureBox7.Tag.ToString() == "A")
     {
          pictureBox7.Image = KaminuSkaiciuokle.Properties.Resources.IcopalB;
          pictureBox7.Tag = "B";
     }
     else
     {
          pictureBox7.Image = KaminuSkaiciuokle.Properties.Resources.IcopalA;
          pictureBox7.Tag = "A";
     }
  </code></pre>