title: Checkbox control to enable other controls on form
body: <p>I'm building a form for searching a database inside my application, and I only want to add a control's input as a <code>WHERE</code> if its enabled. The best method I have found is a set of checkboxes next to each set of controls to enable them.</p>
  
  <p><img src="https://i.stack.imgur.com/m8fP7.png" alt="enter image description here"></p>
  
  <p>Now, I can add the logic to the <code>CheckedChanged</code> of each checkbox, but I have several different types of controls- textboxes, datepickers, comboboxes. So they would have to be done individually- leading to quite a bit of boilerplate code.</p>
  
  <pre><code>private void ChartCheckBox_CheckedChanged(object sender, EventArgs e)
  {
      ClassComboBox.Enabled = ChartCheckBox.Checked;
  }
  </code></pre>
  
  <p>Is there a faster way to do this?</p>