hello
I can't figure out how to get part of my form to repeat
this is what I have at the moment:
Public Class Form5
Dim randomnum As New Random
Dim iNum1 As Integer
Dim iNum2 As Integer
Dim iNum3 As Integer
Dim iNum4 As Integer
Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
iNum1 = randomnum.Next(1, 301)
iNum2 = randomnum.Next(1, 301)
iNum3 = randomnum.Next(1, 301)
iNum4 = randomnum.Next(1, 301)
Label2.Text = pupilName
Label4.Text = iNum1
Label6.Text = iNum2
Label8.Text = iNum3
Label10.Text = iNum4
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'create random numbers all over again for questions 5 times over'
For I = 0 To 5
Me.Form5_Load()
Next
Form6.ShowDialog()
End Sub
Private Sub Question1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Question1.TextChanged
If iNum1 + iNum2 = CInt(Question1.Text) Then
Total = Total + 1
End If
End Sub
Private Sub Question2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Question2.TextChanged
If iNum3 - iNum4 = CInt(Question2.Text) Then
Total = Total + 1
End If
End Sub
End Class
I am trying to get get the random numbers to regenerate again after the button is clicked, I want it to do this 5 times, before moving onto the next form.
also every time the button is clicked if the answers to the questions are right I want to add 1 to their total score.
any help or hints would be greatly appreciated
thanks :)