一、遍历窗体控件
1.普通页面遍历TextBox控件清空的方法,其他控件类似
foreach(Control c in this.controls)
{
if(c is TextBox)
{
TextBox tb=(TextBox)c;
tb.Text=String.empty;
}
}
//或
foreach (Control col in this.Controls)
{
if (col.GetType().Name.Equals("TextBox"))
{
((TextBox)col).Text = String.empty;
}
}
1.普通页面遍历TextBox控件清空的方法,其他控件类似
f