title: Why won't the if statement run?
body: <p>So I am trying to make a chess game (the board is 64 buttons) and I need to check if the button that was first pressed is a certain button but for some reason the code in the if statement will not run.     </p>
  
  <pre><code>public void button_click(object sender, EventArgs e)
      {
          if (partOfTurn == false)
          {
              //code
  
              previousButton = (Button)sender;
              partOfTurn = true;
          }
  
          else if (partOfTurn == true) 
          {
              //code
  
              click();
              partOfTurn = false;
          }
  
          void click()
          {
              if (turn == true)
              {
                  if (previousButton.BackgroundImage == Properties.Resources.White_Pown)
                  {
                      //unreachable code
                  }
              }
          }
      }
  </code></pre>
  
  <p>Edit:
  People are asking for more info:</p>
  
  <p>partOfTurn identifies if it is the first button press of a turn or the second.</p>
  
  <p>Yes, I did debug it and it looks like it acts like the statement is false when it is true.</p>
  
  <p>White_Pown is a file.</p>