在Form窗体的按钮写
Class1 clear = new Class1();
clear.clearText(this);
新建一个类
public void clearText(Form from)
{
foreach (Control c in from.Controls)
{
if (c is TextBox)
{
c.Text = "";
}
if (c is ComboBox)
{
c.Text = "";
}
}
}
以后要用直接调用就行yes