Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Snippet] Random pick from list (Range)
#1
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.
USB Anti-virus? Try USB Drive Defender
[Image: 8bQCusS.jpg]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Snippet] Autoclose Msgbox euverve 7 3,335 05-25-2011, 06:41 PM
Last Post: Pyratepig
  [Snippet] Check Email if gmail and valid password length euverve 4 1,859 05-20-2011, 06:51 AM
Last Post: stephen5565
  [Snippet] Get Local Getway euverve 1 1,041 05-16-2011, 07:56 PM
Last Post: KoBE
  [How to] Create random strings(upper,lower and integers)[Src] Modestep 11 3,076 05-14-2011, 02:17 AM
Last Post: モrainee
  [Snippet] Get OS Uptime euverve 0 893 05-12-2011, 07:08 PM
Last Post: euverve

Forum Jump:


Users browsing this thread: 1 Guest(s)