In this simple Lottery simulation, how do I ensure that a number is not generated twice? I am assuming I need to search the array to verify that there are no equal values but how? Thanks much.

Public Class Lottery

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim counter As Integer = 0

Dim y As Integer

Dim instance As New Random()

Dim myArray(5) As Integer


While counter < myArray.Length

y = instance.Next(1, 37)

myArray(counter) = y

counter = counter + 1

TextBox1.Text = TextBox1.Text & y & (" ")

End While

End Sub