title: Hide selected checkboxes in form
body: <p>I have a little problem about checkboxes. I want to hide the boxes that are selected when I press the button.</p>
  
  <p>I wrote a piece of code like</p>
  
  <pre><code>foreach (CheckBox button in Controls)
          {
              if (button.Checked == true)
              {
                  button.Hide();
              }
          }
  </code></pre>
  
  <p>It works but I get a logical error. How can I solve this problem?</p>