Hey guys first post. My question is I have a program that is used to add inputs to an array when the OK button is clicked. My problem is that the after the first click of the OK button the Do while loop does not execute again for a 2nd click. Any help would be great this assignment has me pulling out my hair. Here is the code.
VB.NET:
Public Class InputValue
Public Shared InputArray(0 To 9) As Integer
Private Sub OkButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OkButton.Click
Dim LoopCounterInteger As Integer
Dim InputInteger As Integer
Dim CounterInteger As Integer
LoopCounterInteger = 0
Do While LoopCounterInteger < 1
Try
InputInteger = Integer.Parse(UserInputTextBox.Text)
Catch ex As Exception
End Try
LoopCounterInteger += 1
InputValueLabel.Text = "Please enter value # " & CounterInteger + 1 & " of 10:"
InputArray(CounterInteger) = InputInteger
CounterInteger = CounterInteger + 1
Loop
If CounterInteger = 10 Then
For Each value As String In InputArray
CannataArrayValues.InputListBox.Items.Add(value)
Me.Close()
Next
End If
End Sub
Private Sub ExitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitButton.Click
Me.Close()
End Sub
End Class
Last edited by a moderator: