title: Using a control as input for a method
body: <p>Im trying to create a method that will make all textboxes Enable property false. The method input will be the tab name, but something is not working</p>
  
  <pre><code>public void fechacampos(Control tab)
      {
          foreach (Control control in this.tab.Controls)
          {
              if (control is TextBox)
              {
                  TextBox tb = control as TextBox;
                  tb.Enabled = false;      
              }
          }
      }
  </code></pre>
  
  <p>Can someone help? Thanks!</p>