On the form 10-15 TextBox 's, you need to consistently check them for emptiness, as it can be rationally implemented, so as not to write 15 times
if(tb1.Text=="") { } You can sort out something like that if everything is in the root:
foreach(var pb in this.Controls.OfType<TextBox>()) { //do stuff } and inside already run the check.
If there are GroupBoxes on the form, then you need to connect a recursion or a stack.
Adequate option, I think, will throw all the TB objects in the collection and check in the loop.
Source: https://ru.stackoverflow.com/questions/582780/
All Articles
TextBox: www.stackoverflow.com/a/565935/177382 (second option). - Dmitry D.