private void btn清空_Click(object sender, EventArgs e)
{
foreach (Control control in this.Controls)
{
if (control is TextBox)
{
((TextBox)control).Clear();
}
}
}
{
foreach (Control control in this.Controls)
{
if (control is TextBox)
{
((TextBox)control).Clear();
}
}
}
本文介绍了一个简单的C#方法,该方法能够遍历窗体上的所有控件,并清除TextBox控件中的文本内容。

1274

被折叠的 条评论
为什么被折叠?



