title: WinForms and C#: How to disable buttons in a groupbox?
body: <p>My goal is to disable all buttons (1 and 2) in groupbox1 (see the picture at the end). When I call the following Method DisableAllButtons(), only button 3 is disabled. What am i doing wrong?</p>
  <pre><code>    private void DisableAllButtons()
      {
          try
          {
              foreach (Control c in Controls)
              {
                  Button button = (Button)c;
                  button.Enabled = false;
              }
          }
          catch
          {
          }
      }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/Ht9Rh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ht9Rh.png" alt="Example WinForm" /></a></p>