代码如下:
foreach (Control ctl in this.Controls)
{
if (ctl.GetType == typeof(TextBox))
{
((TextBox)(ctl)).Text = string.Empty;
}
}
foreach (Control ctl in this.Controls)
{
if (ctl.GetType == typeof(TextBox))
{
((TextBox)(ctl)).Text = string.Empty;
}
}