Reputation: 23
So I have a stack panel, and users click a button and it adds a text box in the stack panel. I got that down. The naming system is such that it names each textbox individually ("textboxname" + I). However, I have no clue how to get the text back from they textboxes to use elsewhere. Anyone got any idea for to get the text from a textbox that's a child of a stack panel?
Upvotes: 1
Views: 1275
Reputation: 11233
You can use:
Me.Controls.Find("yourTextBoxName", true)
Here passing true
is necessary since it help to find the control in child controls as well. Since you have StackPanel
over the root parent control and containing Textboxes.
For more info and a clear solution, you can check this link.
EDIT:
You should use this custom function.
Upvotes: 1