title: C# WPF uncheck checkboxes
body: <p>I use MS Visual 2013 Express, C#, and WPF.</p>
  
  <p>In my program there are six checkboxes, and when one of them is checked, the other five should get unchecked.</p>
  
  <p>I googled the last two hours, but can't find a solution as a beginner in C#. In java, i would just write <code>checkbox1.setSelected(false);</code></p>
  
  <p>I added a clickevent, a checked and unchecked evet in the C# code. I added <code>Checked</code> and <code>Unchecked</code> in the .xaml, but I don't know hot to get it to work.</p>
  
  <p>Hope you can help me :)</p>
  
  <p>=======================</p>
  
  <p>My solution:</p>
  
  <p>Thank you for your help. I tried some random stuff with "IsChecked" you suggested and get it to work luckily.</p>
  
  <p>.Xaml looks like:</p>
  
  <pre><code>            &lt;CheckBox x:Name="CheckBox1" ... Checked="CheckBox1_Checked"  /&gt;
              &lt;CheckBox x:Name="CheckBox2" ... Checked="CheckBox2_Checked"  /&gt;
              &lt;CheckBox x:Name="CheckBox3" ... Checked="CheckBox3_Checked"  /&gt;
              &lt;CheckBox x:Name="CheckBox4" ... Checked="CheckBox4_Checked"  /&gt;
              &lt;CheckBox x:Name="CheckBox5" ... Checked="CheckBox5_Checked"  /&gt;
              &lt;CheckBox x:Name="CheckBox6" ... Checked="CheckBox6_Checked"  /&gt;
  </code></pre>
  
  <p>C# code for CheckBox1:</p>
  
  <pre><code>    private void CheckBox1_Checked(object sender, RoutedEventArgs e)
      {
          CheckBox1.IsChecked = true;
          CheckBox2.IsChecked = false;
          CheckBox3.IsChecked = false;
          CheckBox4.IsChecked = false;
          CheckBox5.IsChecked = false;
          CheckBox6.IsChecked = false;
      }
  </code></pre>
  
  <p>e.g. for CheckBox2:</p>
  
  <pre><code>    private void CheckBox2_Checked(object sender, RoutedEventArgs e)
      {
          CheckBox2.IsChecked = true;
          CheckBox1.IsChecked = false;
          CheckBox3.IsChecked = false;
          CheckBox4.IsChecked = false;
          CheckBox5.IsChecked = false;
          CheckBox6.IsChecked = false;
      }
  </code></pre>
  
  <p>So in the end, it is a very easy task to do.</p>