i worked it out, you can delete this post. sorry
Printable View
i worked it out, you can delete this post. sorry
How about using the Random class? Might be other ways to do as well.
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim names() As String = {"Anna", "Jim", "Claire", "Rob"} Dim random As New Random(Now.Second) ' Or some other seed Dim i As Integer i = random.Next(names.GetLowerBound(0), names.GetUpperBound(0)) TextBox1.Text = names(i) End Sub