C# Winform检查所有textBox内容是否为空--采用控件数据方式

 1 foreach(Control c in this.Controls)
 2 {
 3   if (c is TextBox)
 4   {
 5     if (string.IsNullOrEmpty((c as TextBox).Text))
 6     {
 7       MessageBox.Show("请正确填写内容,带*为必填内容");
 8       return;
 9     }
10   }
11 }
原文地址:https://www.cnblogs.com/braceli/p/5344019.html