title: How to check if multiple checkboxes are checked
body: <p>So in my program, i have three checboxes (A, B and C). and I want to save the content of the checkbox the is checked to a text file. I am doing this using if statements as shown below: </p>
  
  <pre><code>if (a.IsChecked == true)
  {
      res = a.Content.ToString() + " is checked"; 
  }
  else if (b.IsChecked == true)
  {
      res = b.Content.ToString() + " is checked";
  }
  else if (c.IsChecked == true)
  {
      res = c.Content.ToString() + " is checked";
  }
  </code></pre>
  
  <p>And here is where i am saving the above values to a string and then later in my code to a text file </p>
  
  <pre><code>string test = res;
  </code></pre>
  
  <p>Now this is working for me. So i decided to try to check if multiple checkboxes are being checked. So added the below if statements:</p>
  
  <pre><code>else if ((a.IsChecked == true) &amp;&amp; (b.IsChecked == true) &amp;&amp; (c.IsChecked == true))
  {
      res= a.Content.ToString() + " " + b.Content.ToString() + " " + c.Content.ToString()
  }
  </code></pre>
  
  <p>but this isn't working with me because in the end res is printed in the text file as a rather than a b c. Any idea what i am doing wrong? </p>
  
  <p>Also please note that i already initialized res at the top of my code as string:</p>
  
  <pre><code>string res;
  </code></pre>
  
  <p>I am not getting any error when i run my code so i am not sure where my mistake is. any help with this is much much appreciated.</p>
  
  <p>thanks a lot :)  </p>