public
void
GetControls(Control.ControlCollection ctc)
{
foreach
(Control con
in
ctc)
{
if
(!con.HasChildren)
{
if
(con.GetType().ToString() ==
"System.Windows.Forms.ComboBox"
)
{
(con
as
ComboBox).Text =
"123"
;
continue
;
}
}
GetControls(con.Controls);
}
}
/*-------调用---------*/
调用: GetControls(this.Controls);