I am trying to create a game in VB6 where the user guess a number in a certain range depending on the level (Easy 1-5, Medium 1-15, Hard 1-30). I can't get the game to create a random number.
Private Sub cmdGo_Click()
[B]Dim Randomize As New Random[/B]
If optEasy.Value = True Then
lblNumber.Visible = False
lblWas.Visible = False
lblWin.Visible = False
[B]lblNumber.Caption = Randomize.Next(1, 5)[/B]
If txtAnswer.Text = lblNumber.Text Then
lblNumber.Visible = True
lblWas.Visible = True
lblWin.Visible = True
lblWin.Caption = "YOU ARE CORRECT !!!"
cmdGo.Enables = False
txtAnswer.Enabled = False
Else
lblNumber.Visible = True
lblWas.Visible = True
lblWin.Visible = True
lblWin.Caption = "You are WRONG. :( Sorry."
End If