foreach(Control c inthis.Controls)ITPforeach(Control c in this.Controls) { listBox1.Items.Add(c.Name); Control c1 = c as Button; if(c1!=null) { c1.Text="This is A Button"; }
<br />foreach(Control c in this.Controls)ITPforeach(Control c in this.Controls)<br />{<br />listBox1.Items.Add(c.Name);<br />Control c1 = c as Button;<br />if(c1!=null)<br />{<br />c1.Text="This is A Button";<br />}<br />