Click here to Skip to main content
15,892,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to store multiple inputs at run time in the text box and displays the output in listbox.

for this am using for loop to get multiple inputs and how can i store it???

I placed two text boxes , one for getting name and other for age. I am going to give multiple persons name and age and I'm going to display it in list box. what shall I do for this????
Posted
Updated 13-Sep-12 21:40pm
v3
Comments
arul mozhi 14-Sep-12 4:40am    
THANKU SO MUCH....

Not going to work.

The problem is that Windows programming (and the "Text Box" and "List Box" references say you are programming for a GUI environment) does not work with loops like you are used to with console based applications. Instead, it works with Events which occur when the user does something (or when something else happens in the system).

You need to go back to your lecture notes, or book and read more carefully - there are fundamental detials you have either glossed over or not understood yet.
 
Share this answer
 
If you are developing Window based application, no need to use for loop. You can have a button on your UI which when clicked, you add the inputs (from your specified textboxes) to the listbox.

For that matter you've to handle the 'Click Event' of that button (we can call it 'Add Button'). On this 'Add' button click event you have to perform activities like adding the content from textboxex to list and clearing them (so that user can visualize the content adding, and is ready to add next content).
 
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