I am trying to sum up a listbox of currency values in vb 2012. How do I do this? The total needs to be entered into a textbox and updated when an item is added or removed.
Reply from Richard Rost:
I don't have VB2012 installed right now to tell you the exact code, but if memory serves it's pretty similar to VB6. Just use a For Next loop, something along the lines of:
For X = 0 to ListboxName.ListCount - 1 MyVal = MyVal + ListboxName(X) Next
Something along those lines.
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Visual Basic Forum.