Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Programming Thread

Name: Anonymous 2013-10-03 0:11

This thread is about /prog/ramming for /prog/rammers and /DPT/ers

What are you working on?

Name: Anonymous 2013-10-03 12:09

I can't seem to get this to work. Any ideas on how to fix it?


Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnUserInput.Click
        Dim strUserInput
        Dim IntUserInput As Integer
        Dim i As Integer
        strUserInput = InputBox("Enter a positive integer value", "Input Needed", 10)
        If strUserInput <> String.Empty Then
            Try
                IntUserInput = CInt(strUserInput)
                If IntUserInput < 0 Then
                    MessageBox.Show("Negative numbers are not accepted.")
                    Exit Sub
                End If

                MessageBox.Show("Sum of Numbers", "The sum of numbers" & (i + IntUserInput), MessageBoxButtons.OK)

            Catch ex As Exception
                MessageBox.Show("Quantity amount must be numeric.")
            End Try
        Else
            MessageBox.Show("Error, input valid number", "You must enter a positive integer value", MessageBoxButtons.OK)
            Exit Sub
        End If

    End Sub
End Class

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List