c# - Get text from dynamically created TextBox -


i have button when clicked creates textboxes dynamically:

        (int = 0; < length; i++)         {          name.add(new textbox());          system.drawing.point locate = new system.drawing.point(137, 158 + * 25);          (name[i] textbox).location = locate;          (name[i] textbox).size = new system.drawing.size(156, 20);          starttab.controls.add(name[i] textbox);          } 

i want text entered in name[i] convert string set labels

you can use control.controlcollection.find.

updated:

textbox txtname =  (textbox)this.controls.find("txtnameoftextbox", true)[0];  if (txtname != null) {     return txtname.text; } 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -