My textBoxes Is contained on panel3 and panel3 is above on panel2
I want validate textboxes my code is
public void ClearTextBoxes(Control.ControlCollection cc)
{
foreach (Control ctrl in cc)
{
TextBox tb = ctrl as TextBox;
if (tb == null)
messagebox.show("Empty Textbox Found");
}
}
but It Throws an error -"Object refference not set an instance of an object"

Manikandan MurugesanRank #300 · 8.4K reputationPosted Jul 7, 2017, 7:39 AM EDT
Murli Jadhav93 reputationPosted Jul 7, 2017, 8:48 AM EDT
Manikandan Murugesan It Is Not Work For Me Because all of my textboxes is on panels