private void CleanForm() { foreach (var c in this.Controls) { if (c is TextBox) { ((TextBox)c).Text = String.Empty; }
Maybe you want more simple and short approach. This will clear all TextBoxes too. (Except TextBoxes inside Panel or GroupBox).
foreach (TextBox textBox in Controls.OfType()) textBox.Text = "";