遍历winform 页面上所有的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 @ 2017-11-22 16:23  橘子拾光  阅读(646)  评论(0编辑  收藏  举报