Hi, I'm trying to get a group of MP3 files to play one after the other, using Visual Basic 2008.
I have the songs in a folder, I can load and play them one at a time, or I can load a playlist but I'm having trouble getting the player to recognize when one song ends, it just stops at the end of the song. How do you get the player to recognize that one song has ended and play the next song in the listbox? I have tried using a loop through the index of the listbox, but again when the song reaches an end it stops and you have to load the next song yourself.
Private Sub btnPlayAll_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlayAll.Click
Me.tmrPlay.Enabled = True
If Me.AxWindowsMediaPlayer1.Ctlcontrols.currentPositionString >= Me.AxWindowsMediaPlayer1.currentMedia.durationString.TrimEnd Then
intPos = intPos + 1
If intPos > intMax Then
intPos = 1
Fill_Screen() '' reads array to text boxes on the form.
Me.AxWindowsMediaPlayer1.URL = Trim(strData(4, intPos)) 'Play the currently selected song