title: Looping through controls
body: <p>In my code I need to loop through the controls in a GroupBox and process the control only if it a ComboBox. I am using the code:</p>
  
  <pre><code>foreach (System.Windows.Forms.Control grpbxChild in this.gpbx.Controls)
  {
      if (grpbxChild.GetType().Name.Trim() == "ComboBox")
      {
          // Process here
      }
  }
  </code></pre>
  
  <p>My question is: Instead of looping through all the controls and processing only the combo boxes is is possible to get only the combo boxes from the GroupBox? Something like this:</p>
  
  <pre><code>foreach (System.Windows.Forms.Control grpbxChild in this.gpbx.Controls.GetControlsOfType(ComboBox))
  {
      // Process here
  }
  </code></pre>