Help with VB.net...........?

Royale

New member
I'm faced with an illogical problem, In my eyes I'm doing everything right. I'm trying to make the msgbox display you're right if the question is correct and wrong if its not, but all it does it display wrong all over. Here is the code

Randomize()
TextBox1.Text = (Int(Rnd() * 20 + 1))
TextBox2.Text = (Int(Rnd() * 20 + 1))


Label1.Text = "+"

If Val(Label4.Text) = 1 Then
Button1.PerformClick()
End If

Dim num1 As Integer
Dim num2 As Integer
Dim answer As String
num1 = Val(TextBox1.Text)
num2 = Val(TextBox2.Text)
answer = Val(TextBox3.Text)
If answer = num1 + num2 = True Then
MsgBox("You're Right")
ElseIf answer = num1 + num2 = False Then
MsgBox("Wrong")
 
Back
Top