-
Addition in VB
Hi , im having trouble with addition in VB.NET 2003 :confused:
I have a listbox which the user inputs a variety of numbers, in the form (minutes.seconds) so, (24.32)
I am looking for some code/tips/help that adds the total in the listbox, continually updating the total.
Eg. User Adds 22.32
Total = 22.32
User Adds 21.12
Total = 43.44 e.t.c
Thanks ! :wave:
-
Unfortunately there doesn't seem to be an event relating to when the number of items changes in a listbox, but you could create your own. Raise the event whenever you clear the listbox, add an item to the listbox, or remove one.
When you handle the event, just use a private variable that keeps track of the current tally, and add/subtract from it accordingly.