To clear all textboxes text easily by using foreach loop.
For example if we have more than one textboxes in our form and we have to clear all textboxes when we click on clear button, then write the following code in clear button click event using foreach loop.
private void btnClear_Click(object sender, EventArgs e)
foreach (Control X in this.Controls)
if (X is TextBox)
X.Text = " ";