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

时间:2021-01-06 13:57:10   收藏:0   阅读:31

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 ; }

}

原文:https://www.cnblogs.com/knandnk/p/14240471.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!