foreach (Control ctrl in this.Controls)
{
if (ctrl.GetType().Name == "TextBox")
{
TextBox tb = ctrl as TextBox;
tb.Clear();
}
}
Doing operations on all and same controls at a time
Suppose we want do the same type of operations like clearing all textboxes at a time then wecan do like this


Join the conversation! Your thoughts help the community grow.