
December 9th, 2003, 12:52 PM
|
|
PHP/PERL/.NET Coder
|
|
Join Date: May 2001
Location: Daytona Beach, Florida
Posts: 36
Time spent in forums: 41 sec
Reputation Power: 8
|
|
|
this might be a little overkill but here we go:
First thing is, will you have to retrieve these values after the user exits and re-enters the application?
Theres a couple of different ways you could do this:
1) This would require access to a SQL database. Simply insert a new row with a unique id each time the user adds an entry, then grab the table into a dataset and attach the dataset to the listbox.
2) Store the entries in a new Dataset, persist the dataset to xml so the file can be stored on the users local machine, then attach the dataset to the listbox like option 1. this is the same as option 1 except a sql server wouldn't be required, but then the changes are only local to that users machine.
3) create a custom object named something like myEntry. this class would have properties like :
Value (the value they entered)
Action (this would be either add or subtract)
then store all of these objects into an arraylist. You can then bind the arraylist to the listbox.
I would recomend not just adding the text value to the listbox as this leaves little room for scalability, but if you don't expect this app to change much at all you can just add the value to the listbox item collection when they click the button.
You get the idea.
__________________
"Mankind cannot define memory, yet it defines mankind"
|