C#批量操作控件,如批量修改TextBox的值或清空
foreach (Control control in this.groupBox2.Controls) { if(control is TextBox) { if(control.Name != "text_JSBS") { control.Text = "0.00"; } } }
以上代码是批量 修改 groupbox2里面的TextBox值