考试
1970-01-01 08:00:00

请编程遍历页面上所有TextBox控件并给它赋值为strin

题目描述

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

加载中...
AI正在思考中,请稍候...