Hi, 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:
foreach (System.Windows.Forms.Control grpbxChild in this.gpbx.Controls)
{
if (grpbxChild.GetType().Name.Trim() == "ComboBox")
{
// Process here
}
}
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:
foreach (System.Windows.Forms.Control grpbxChild in this.gpbx.Controls.GetControlsOfType(ComboBox))
{
// Process here
}