05-12-2011, 08:22 AM
Code:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
MsgBox(getrandom)
End Sub
Shared Function getrandom() As String
Dim Random As New Random
Dim order As New List(Of String)
order.AddRange(New String() {"First", "Second", "Third", "Fourth", "Fifth", _
"Sixth", "Seventh", "Eight", "Ninth", "Tenth", })
Dim itemnumber As Integer = Random.Next(order.Count)
Return order(itemnumber)
End Function
Every time you click on msgbox it random pick the result from list/range.