title: MP3 Player Random Function doesn't Work
body: <p>I just started my first project and i'm trying to make a mp3 player.
  Unfortunately My "Random" causes the whole program to crash when i'm trying to open a song. </p>
  
  <p>This is the error produced in Visual Studio Ultimate 2013:</p>
  
  <pre><code>An exception of type 'System.ArgumentOutOfRangeException' occurred in System.Windows.Forms.dll but was not handled in user code
  
  Additional information: InvalidArgument=Value of '1' is not valid for 'index'.
  </code></pre>
  
  <p>Please tell me what's wrong with my code, This is a link to my repository in Github, Thanks!</p>
  
  <p><a href="https://github.com/LefanTan/MP3_Player/tree/Mp3" rel="nofollow">https://github.com/LefanTan/MP3_Player/tree/Mp3</a></p>
  
  <p>Edit:
  This line is the code that was producing the error-</p>
  
  <pre><code>Private Sub wpm_PlayStateChange(sender As Object, e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) Handles wpm.PlayStateChange While shuffle.CheckOnClick = True tempInt = r.Next(0, ListBox1.Items.Count + 1) wpm.URL = ListBox1.Items(tempInt) End While While RepeatToolStripMenuItem1.CheckOnClick = True wpm.URL = currentSong End While End Sub
  </code></pre>