Hello all,
Newbie to programming and VB.NET, but it is a class requirement for grad school so I suspect I will be on here a lot for the semester.
My professor wants us to create a program for kids that tests their math skills. Basically it will randomize 2 numbers and ask them to add or subtract them. It will give them a text box to type their answer. Once they enter the answer they will click on a calculate button and it will display if the answer is right or wrong. I have this part of the program working.
What I am having a problem with is the following... I need to keep track of the number of tries that are attempted and display the correct answer after 3 failed attempts.
I have tried the following for the button click but it doesn't seem to want to work. It just displays " 1 time" every time I change the answer and click the button.
Newbie to programming and VB.NET, but it is a class requirement for grad school so I suspect I will be on here a lot for the semester.
My professor wants us to create a program for kids that tests their math skills. Basically it will randomize 2 numbers and ask them to add or subtract them. It will give them a text box to type their answer. Once they enter the answer they will click on a calculate button and it will display if the answer is right or wrong. I have this part of the program working.
What I am having a problem with is the following... I need to keep track of the number of tries that are attempted and display the correct answer after 3 failed attempts.
I have tried the following for the button click but it doesn't seem to want to work. It just displays " 1 time" every time I change the answer and click the button.
VB.NET:
Dim numTimes as Integer = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
numtimes += 1
label1.text ("Button1 has been clicked" & numTimes & " times.")
End Sub