for (int 1=0;i<20;i++) { lbl + i.tostring().padleft(0,3) .text - "Hello world"; }
foreach(Control ctl in this.Controls) { if(ctl.GetType()==typeof(Label)) { ctl.Text="Hello World"; } }
foreach (Control c in parent.Controls) { int cnt = 1; if (c.GetType() == typeof(Label)) { if (c.Name == "lbl" + cnt) { //Do Stuff with the control cnt++; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)