foreach(Control ctrl in groupBox1.Controls)
{
if(ctrl is TextBox)
{
TextBox t = (TextBox)ctrl;
t.Text = String.Empty;
}
}
Note: If the textboxes are on the form directly then replace the "groupBox1.Controls" to "this.Controls".
foreach(Control ctrl in groupBox1.Controls)
{
if(ctrl is TextBox)
{
TextBox t = (TextBox)ctrl;
t.Text = String.Empty;
}
}
No comments:
Post a Comment