0

Well i need some help in doing so
when i click a button , an inputbox should come up taking say 10 numbers
then is it possible to add the numbers that are input into this inputbox and display it into a textbox or msgbox
or
after inputting the numbers they will be stored in a listbox and then they will be added together and displayed in a textbox or msgbox

well i started off like this..
when the btn is clicked

Dim Marks As Integer
        For i = 1 To 10
            Marks = InputBox("Enter The Marks")
            listbox1.items.add(Marks)
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by Unhnd_Exception
0
Dim temp As String
        Dim total As Integer

        ListBox1.Items.Clear()

        For i = 1 To 10
            temp = InputBox("Enter the Marks")
            If String.IsNullOrEmpty(temp) OrElse Not IsNumeric(temp) Then Continue For
            ListBox1.Items.Add(temp)
            total += temp
        Next

        MsgBox(total)

        'or you could total the numbers with the list box items
        For i = 0 To ListBox1.Items.Count - 1
            total += ListBox1.Items(i)
        Next
        MsgBox(total)
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.