Click here to Skip to main content
15,917,454 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all.

How to get the values of the dynamically created textbox to be displayed one below another.

i have the dynamic text boxes like

text button
text button
text button
text button

when i click the button next to the respective textbox its getting incremented. No issues in that.
Note all above controls text and button are created dynamically based on the number of items in listbox.

Now am placing a button manually. i need to get the current values in respective textbox to new listbox (created manully).

how to do so? Please help. badly needed this
Posted

1 solution

Without seeing how you are creating teh controls its difficult but here's an overview of what I might do...

When I create the texbox and button, set the Button's Tag property to the TextBox

Now when I click the button I can access the textbox with

C#
string myString = (TextBox)(button.Tag).Text;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900