Code:Dim rndm As New Random Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If ListBox1.Items.Count > 0 Then Dim i As Integer = rndm.Next(0, ListBox1.Items.Count) TextBox1.Text = ListBox1.Items(i).ToString ListBox1.Items.RemoveAt(i) End If End Sub




Reply With Quote