|
-
May 2nd, 2014, 03:22 AM
#1
Thread Starter
Junior Member
What's wrong with this code? - Beginner
Hello VBForums.
Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If TextBox1.Text = TextBox2.Text Then
MsgBox("The scores have Evened!")
End If
If TextBox1.Text > TextBox2.Text Then
MsgBox("Orange team in the lead!")
End If
If TextBox1.Text < TextBox2.Text Then
MsgBox("Blue Team in the lead!")
End If
End Sub
I want this code to make MsgBox's that appear every time the scores in the MsgBox's apply to these rules. So when the TextBox2 (Team 2)'s score overtakes Team one it will display the Message.
The Code I have in there currently just makes the first MsgBox "The scores have Evened!" it does it once when I start the program then doesn't do it again.
I don't want it to repeat the code every time to score is updated such as score 10-15 then 10-17 "Blue Team in the lead!"
So it only displays the MsgBox's when the score evens or when one team overtakes.
Thanks.
-
May 2nd, 2014, 04:40 AM
#2
Re: What's wrong with this code? - Beginner
Read my reply in this thread again. You are putting the code in the WRONG SUB!
-
May 2nd, 2014, 09:30 AM
#3
Re: What's wrong with this code? - Beginner
Right, that doesn't belong in Form Load, it belongs elsewhere, and I think Espanolita covered the options in the other thread. So, this is just a second opinion.
My usual boring signature: Nothing
 
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|