Hi,
I want to add a button (ButtonCalculate) to make the user select this button to generate the loop for calculating the sum.
Private Sub TextBox1Integer_TextChanged(sender As System.Object, e As System.EventArgs) Handles TextBox1Integer.TextChanged
Dim OddSum As Integer = 0
Try
Dim CountTo As Integer = TextBox1Integer.Text
For Index As Integer = 1 To CountTo
If Index Mod 2 <> 0 Then
OddSum += Index
End If
Next
Label1Output.Text = "Sum is: " & OddSum.ToString
Catch ex As Exception
MessageBox.Show("Error - Please Enter An Integer")
End Try
End Sub