foreach(Control control in GroupBox.Controls)//GroupBox 改为groupbox控件名
{
if(control is TextBox)
{
(control as TextBox).Text = control .Name.Substring ("textBox".Length);
}
}
foreach(Control gb in this.Controls)
{
if(gb is GroupBox)
{
foreach (Control ctl in gb.Controls)
{
if (ctl is TextBox && ctl.Name == name)
{
ctl.Text = i.ToString();
}
}
}