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
Post a Comment