[RESOLVED] Play all songs (Resolved)
Hi,
I'm using the Windows mediaplayer control to play mp3s but I can't get it to play songs in a list. This is the code I'm using:
VB Code:
Private Sub MediaPlayer1_EndOfStream(ByVal Result As Long)
frmSetup.Lstsongs.ListIndex = frmSetup.Lstsongs.ListIndex + 1
MediaPlayer1.FileName = frmSetup.Lstsongs.Text
MediaPlayer1.Play
End Sub
Function Play()
'If cancel then close the program
'Else choose and play a song
On Error Resume Next
Music1.ShowOpen
If Err.Number = "32755" Then
MediaPlayer1.Stop
Unload Me
End If
If frmSetup.Songopt(0).Value = True Then
MediaPlayer1.FileName = Music1.FileTitle
MediaPlayer1.Play
mnuPlay.Checked = True
End If
If frmSetup.Songopt(1).Value = True Then
frmSetup.Lstsongs.AddItem Music1.FileName
x = MsgBox("Do you want to add more songs?", vbYesNo)
If x = vbYes Then
Music1.ShowOpen
frmSetup.Lstsongs.AddItem Music1.FileName
ElseIf x = vbNo Then
MediaPlayer1.FileName = frmSetup.Lstsongs.Text
MediaPlayer1.Play
End If
End If
End Function
It plays the first song then goes straight to the last song skipping all the songs in between.
TIA
NW