我有一个带有 9 个 TextBox 控件的 WinForm 应用程序。如何提醒用户哪些文本框为空或为空?
var incompleteTextBoxes = this.Controls.OfType<TextBox>().Where(tb => string.IsNullOrWhiteSpace(tb.Text));
foreach (var textBox in inCompleteTextBoxes)
{
// give user feedback about which text boxes they have yet to fill out
}