Hello
Try this. Create a form1 with a button and cut and paste this code. Run the program and see the numbers generated.
Notice the dim rnd as new random is not in the same place as the NewRandomNumber = rnd.Next(1, 3) is.
Code:
Public Class Form1
Dim rnd As New Random
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim NewRandomNumber As Integer
Dim astring As String = ""
For x = 0 To 20
NewRandomNumber = rnd.Next(1, 3)
astring += NewRandomNumber.ToString
Next
MsgBox(astring)
End Sub
End Class
Good Luck
George