title: Forms : Enabled/Disable all controls in a container (panel)
body: <p>I am coding a C# Forms application and would like to know how to enable/disable all controls container within a panel.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>private void EnabledPanelContents(Panel panel, bool enabled)
  {
      foreach (var item in panel.Controls)
      {
          item.enabled = enabled;
      }
  }
  </code></pre>
  
  <p>There is no enabled property in the panel.Controls collection.</p>
  
  <p>How can I enable/disable all controls container within a panel.</p>
  
  <p>Thanks in advance.</p>