在网上找的,因为地址记不得,所以无法给出地址。
foreach(control c in this.controls)
{
if(c.gettype().tostring()=="System.Windows.Forms.TextBox")//对象
c.text=""; //当前窗体的所有textbox赋空值
}
f1出来的帮助是:
本文介绍了一种清空窗体上所有TextBox控件的方法,并解释了如何通过遍历窗体控件集合来实现这一目标。同时,文章还提供了有关Control.ControlCollection类的基本使用说明,包括如何高效地添加多个控件到窗体。
在网上找的,因为地址记不得,所以无法给出地址。
foreach(control c in this.controls)
{
if(c.gettype().tostring()=="System.Windows.Forms.TextBox")//对象
c.text=""; //当前窗体的所有textbox赋空值
}
f1出来的帮助是:

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