All of that is dependant on how you "select a textbox" - a textbox doesn't have a "select" function, so either you will have to add that to your textboxes, or you will have to add an external control (such as a CheckBox) which the user can use to indicate if the textbox should be considered selected or not.
If you do that, you could use the TextBox.Tag property to indicate if the textbox is selected and it's simple. If we assume that a
null
value in a Tag indicates not selected, and anything else means "selected" then:
foreach (Control c in Controls)
{
TextBox tb = c as TextBox;
if (tb != null && tb.Tag != null)
{
tb.Text = "";
tb.Tag = null;
}
}
But how to select the boxes is up to you.