Public Class frmSums Dim Ran As New Random Dim Int As New Integer Dim Num1 As New Integer Dim Num2 As New Integer Private Sub frmSums_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed Application.Exit() End Sub Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'Me.Visible = False Randomize() Num1 = Ran.Next(1, 5000) Num2 = Ran.Next(1, 5000) Label1.Text = (Num2) & vbCrLf & " + " & vbCrLf & (Num1) Num1 = Ran.Next(1, 5000) Num2 = Ran.Next(1, 5000) Label2.Text = (Num2) & vbCrLf & " + " & vbCrLf & (Num1) End Sub End Class
I am trying to place random numbers into labels, but the process that i am doing is taking way to long, just wondering if there is an easy way around this? I also need to know the answer to the sums that get placed into the labels and then check that against the answer in the text box.
I have looked all over the DIC forums and nothing meets my queries.
Please help, this is just a quick program for my son so that he can get some sums into him. Thanks