Using an input box (lstInput) and a button (btnCompute) I need to click on the button and enter numbers one at a time in a listbox (lstOutput) it needs to be keeping a running total of the sum
When entering" -1", a grand total will be displayed
Heres my code
Public Class frmPositiveNumbers
Private Sub btnCompute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCompute.Click
Dim num, total As Double
Total = 0
Do until num = -1
Num = Me.txtInput.Text
Me.lstOutput.Items.Add(num)
total += num
Loop
Me.lstOutput.Items.Add(total)
End Sub
End Class
I keep ending in an infinite loop, I am sure its something stupid I am doing.
2007-11-28
11:22:35
·
4 answers
·
asked by
Brian D
4
in
Programming & Design