for (int nCtr=0;nCtr<this.Controls.Count;nCtr++) if (this.Controls[nCtr] is TextBox) // run your code (maybe this.Controls[nCtr].{function})