Here is something much more random that I started using:
I like that much more :]Code:Private Function randomBtn() As Button Dim list As New List(Of Button) For Each btn As Button In Panel1.Controls.OfType(Of Button)() If btn.Enabled = True Then list.Add(btn) End If Next Dim r As New Random Dim i As Integer i = r.Next(0, list.Count - 1) randomBtn = list.Item(i) End Function




Reply With Quote