问题
问答题 简答题
请编程遍历页面上所有TextBox控件并给它赋值为string.Empty?
答案
参考答案:
foreach(System.Windows.Forms.Controlcontrolinthis.Controls)
{
if(controlisSystem.Windows.Forms.TextBox)
{
System.Windows.Forms.TextBoxtb=(System.Windows.Forms.TextBox)control;
tb.Text=String.Empty;
}
}