Having trouble when executed. Can someone point me the right direction?
Public Class Form1
Private Sub btnEnterNumber_Click(sender As Object, e As EventArgs) Handles btnUserInput.Click
'This will sum of the numbers
Dim strUserInput As Integer
Dim intUserInput As Integer 'Number entered by user
Dim intSum As Integer = 0
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 1 through" & (intSum + intUserInput), MessageBoxButtons.OK)
Catch ex As Exception
MessageBox.Show("Quanity amount must be numeric.")
End Try
Else
MessageBox.Show("Incorrect input", "You must enter a positive integer value", MessageBoxButtons.OK)
End If
End Sub
Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
Me.Close()
End Sub
End Class