title: Disable all controls within Groupbox
body: <p>I am trying to disable all controls within <code>Groupbox</code> as shown below, but I am getting error On casting any suggestion ?</p>
  
  <blockquote>
    <p>unable to cast object of type system.windows.forms.checkbox to type
    system.windows.forms.textbox</p>
  </blockquote>
  
  <pre><code>            foreach (Control cont in GB_Product_Entry.Controls)
              {
                  if (cont is TextBox || cont is ComboBox)
                  {
                      ((TextBox)cont).ReadOnly = true;
                      ((TextBox)cont).BackColor = SystemColors.Control;
  
                      ((ComboBox)cont).Enabled = false;
                      ((ComboBox)cont).BackColor = SystemColors.Control;
  
                      ((CheckBox)cont).Enabled = false;
                      //((CheckBox)cont).BackColor = SystemColors.Control;
                  }
              } 
  </code></pre>