嘻皮客娱乐学习网

标题: 请编程遍历页面上所有 TextBox 控件并给它赋值为 string.Empty [打印本页]

作者: dgw123    时间: 2014-11-30 13:51
标题: 请编程遍历页面上所有 TextBox 控件并给它赋值为 string.Empty
foreach (System.Windows.Forms.Control control in this.Controls)
{
if (control is System.Windows.Forms.TextBox)
{
System.Windows.Forms.TextBox tb = (System.Windows.Forms.TextBox)control ;
tb.Text = String.Empty ;
}
}




欢迎光临 嘻皮客娱乐学习网 (http://www.xipick.com/) Powered by Discuz! X3.3