string name = "textBox1"; Control[] control = this.Controls.Find(name); if (control.Length > 0 && control is TextBox) { TextBox txt = (TextBox)control[0]; txt.Text = "My Control"; }Or, even simpler:
string name = "textBox1"; Control control = this.Controls[name]; TextBox textBox = control as TextBox; if (textBox != null) { textBox.Text = "My Control"; }