//************************************** // Name: Randomize ListBox Items // Description:Randomize Listbox Items. I made this to generate a random list for a mp3 player. I added a loop so the listbox gets a good mix up. // By: Thomas Ault // // // Inputs:None // // Returns:None // //Assumes:None // //Side Effects:None //************************************** Try Dim X As Integer = 0 Dim I As Integer Dim str As String = "" Listbox1.Sorted = False Listbox1.BeginUpdate() Do For C = 0 To Listbox1.Items.Count Randomize() I = CInt(Int(C) * Rnd()) str = Listbox1.Items(I) Listbox1.Items.RemoveAt(I) Listbox1.Items.Add(str) Next X += 1 Loop Until X = 3 Listbox1.EndUpdate() Catch ex As Exception MsgBox(ex.Message) End Try End Sub 'Add Listbox1.Sorted=True to a button cl // ick event to reorder the list