Checking if all textboxes in a panel a filled
<p>I currently work on a Windows Forms application and I have 2 Panels with textboxes in them and I need to check the panel's textboxes separately if they are not empty, so it is not an option to loop through all the controls in the form.</p>

<pre><code>            foreach (Control child in this.Controls)
        {
            TextBox textBox = child as TextBox;
            if (textBox != null)
            {
                if (!string.IsNullOrWhiteSpace(textBox.Text))
                {
                    MessageBox.Show("Text box can't be empty");
                }
            }
        }
</code></pre>