遍历TextBox控件

请编程遍历页面上所有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 ;
}
}

posted @ 2018-04-12 12:37  尘夕  阅读(364)  评论(0编辑  收藏  举报