在我的代码中,我需要遍历GroupBox中的控件,并且仅当它是ComboBox时才处理该控件。System.Windows.Forms.Control grpbxChild in this.gpbx.Controls) if (grpbxChild.GetType().Name.Trim() == "ComboBox如下所示:
foreach (System.Windows.Forms.Control grpbxChild in this.gpbx.Controls.GetControlsOfType(ComboBox