title: Change background colour of button after multiple buttons are clicked
body: <p>I am using Visual C# 2010</p>
  
  <p>I have a windows form with about 24 buttons plus a 'Finish' button</p>
  
  <p>Currently the Finish button is red. I want the colour of this button to change to green once all other buttons have been clicked.</p>
  
  <p>When the user clicks button 1 -24 <em>that</em> button changes to green, so I know how to change the background  on a click event.</p>
  
  <p>I have a boolean for when each button is clicked.</p>
  
  <p>This is the code I have so far:</p>
  
  <pre><code>if (button1Clicked &amp;&amp; button2Clicked ...)  // I have button3 through button24 as well
  {
      finishButton.BackColor = Color.Green;
  }
  </code></pre>
  
  <p>However the button remains Red when all 24 buttons have been clicked.
  I have sent the output of button1 to the debug writeline and I know that the boolean changes from false to true when the button is clicked.
  I have made the finish button public in the modifiers option.</p>
  
  <p>Am I missing a step? I thought this should have been easy to accomplish.</p>
  
  <p>EDIT </p>
  
  <hr>
  
  <pre><code>public partial class Form2 : Form
  {
      public bool button1Clicked = false;
      .... // and other buttons are allocated the same way
  }
  
  
  private void button1_Click(object sender, EventArgs e)
  {
      String textForClipboard = String.Format("{0}_S1_{1}", Form1.dateValue, button1.Text);
      Clipboard.SetText(textForClipboard);
      button1.BackColor = Color.Green;
      button1Clicked = true;
      System.Diagnostics.Debug.WriteLine(button1Clicked);
  }
  </code></pre>
  
  <p>EDIT</p>
  
  <hr>
  
  <p>Where exactly should I have the if loop?
  I currently have it in this method</p>
  
  <pre><code>namespace WindowsFormsApplication1
  {
      public partial class Form2 : Form
      {
          ....
  
          public Form2(Form parentForm)
          {
              InitializeComponent();
              mainForm = parentform;
              ....
  
              if (button1Clicked)
              {
                  finishedButton.BackColor = Color.Green;
              }
          }
      }
  }
  </code></pre>