title: foreach control c# skipping controls
body: <p>I have the following loop to remove the buttons in my C# Windows Forms application. The only problem is that it skips every other button. How do I go about removing all the button controls from my form?</p>
  
  <pre><code>foreach (Control cntrl in Controls)
  {
      if(cntrl.GetType() == typeof(Button))
      {
          Controls.Remove(cntrl);
          cntrl.Dispose();
      }
  }
  </code></pre>