Hello all, I am working on a project. I have a TryParse statement that reads:
If Not Integer.TryParse(TextBox1.Text, intPin(0)) Then
MsgBox("Enter a number between 7 and 9.", MsgBoxStyle.OkOnly, "PIN1")
Return False
End If
I have the same statement checking values in different txtBoxes. Then I have a For...Loop statement checking for the min and max values. I have msgBox that incase the For...Loop with the IF statement is false. Instead of msgBox("check your pin"). Would I be able to return the message from the TryParse >>MsgBox("Enter a number between 7 and 9.", MsgBoxStyle.OkOnly, "PIN1") . The message changes for each textbox.
Dim X As Boolean
For intCount As Integer = 0 To (intPin.Length - 1)
If intPin(intCount) >= intMinPin(intCount) AndAlso
intPin(intCount) <= intMaxPin(intCount) Then
Else
X = True
End If
Next
If X Then
MsgBox("Check your pin")
Else
MsgBox("Pin is correct")
End If
Thanks in advance.