i need help figuring out the tryparse method in visual basic i need to verify that both inputs are valid integers. if an error is found, display an appropriate message to the user. the program requires the person to enter two integers and then looks to see which one is larger.
Here is the code I have so far. (if anyone can help i would appreciate it)
Public Class Ch4_1
Private Sub btnCompare_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCompare.Click
'declares the variables that are u to be used in the program
Dim intA As Integer
Dim intb As Integer
'tells the program where to get the values to be used for the variables
intA = txtIntegerOne.Text
intb = txtintegertwo.text
'this is the "if-then" statements the tells the program what to paste in the label when one of these true
If intA > intb Then
lblAnswer.Text = "The first number is larger"
ElseIf intb > intA Then
lblAnswer.Text = "the second number is larger"
ElseIf intA = intb Then
lblAnswer.Text = "The numbers are equal"
End If
If Integer.TryParse(txtIntegerOne.Text, intA) Then
MessageBox.Show("please enter a valid integer")
If Integer.TryParse(txtIntegerTwo.Text, intb) Then
MessageBox.Show("please enter a valid integer")
End If
End If
End Sub
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
'this closese the programbbit
Me.Close()
End Sub
End Class


