I've like to build a script that searches for every textbox and cleares it.
The textbox is on a GroupBox.
I've build this script.. but it doesnt work.. it only searches for the main components on the main form. Not the components on the groupbox.
How can i build it like so the program searches al the components on the GroupBox form ?
The textbox is on a GroupBox.
I've build this script.. but it doesnt work.. it only searches for the main components on the main form. Not the components on the groupbox.
Code:
private void btnWissen_Click(object sender, EventArgs e)
{
foreach (Control tempCtrl in this.Controls)
{
string str = Convert.ToString(tempCtrl.GetType());
if (str == "System.Windows.Forms.TextBox")
{
tempCtrl.Text = "";
}
}
}
How can i build it like so the program searches al the components on the GroupBox form ?