' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Public Class Form1
    Private ReadOnly rng As Random = New Random
    Private nums As List(Of Integer) = New List(Of Integer)(New Integer() {1, 2, 3, 4, 5, 6, 7, 8, 9, 10})
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If nums.Count > 0 Then
            Dim ix As Integer = rng.Next(nums.Count)
            Label1.Text = nums(ix).ToString
            nums.RemoveAt(ix)
        Else
            MessageBox.Show("No more unused numbers left")
        End If
    End Sub
End Class
