I have a listbox filled with integers that can be changed and added to:
I just need a textbox that keeps a running total of the integers in the listbox.
Thanks
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
PJ MartinsPosted Jun 25, 2010, 10:30 AM
Dim itemInt As Integer
Dim total As Integer = 0
For Each item As Object In ListBox1.Items
If Integer.TryParse(item.ToString(), itemInt) Then
total += itemInt
End If
Next
TextBox1.Text = total.ToString()
DavidPosted Jun 25, 2010, 3:38 PM