请编程遍历页面上所有 TextBox 控件并给它赋值为 string.Empty ?

匿名网友 匿名网友 发布于: 2015-08-30 00:00:00
阅读 100 收藏 0 点赞 0 评论 0

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 ;

}

}

评论列表
文章目录