title: How to pick a random item from a listbox in visual Basic
body: <p>How can i pick a random item from a listBox.This is what i have tried.</p>
  
  <pre><code>Public currentTrack As Integer
  Public temp As Integer
  Public generic As Random = New Random()
  temp = gen.Next(0, listTracks.Items.Count + 1)
          currentTrack = temp
          MessageBox.Show(listTracks.Items(currentTrack))
          AxWindowsMediaPlayer1.URL = listTracks.Items(currentTrack)
  </code></pre>
  
  <p>When i display the picked item at a messagebox it pops up 2 message Boxes.Each message box displays a different item.
  example: the first messagebox shows C:\test\blab.mp3
  and the second shows C:\test\bleasds.mp3</p>