To clear my text boxes I was using the following code in a form:
foreach (Control c in this.Controls)
{
if (c is TextBox || c is RichTextBox)
{
c.Text = "";
}
}
But now my text boxes reside within a TabControl. How can I run this same type of check for text boxes, and if the control is a textbox, set the value to “”. I have already tried using:
foreach(Control c in tabControl1.Controls)
But this did not work.
use this