axwindowsmediaplayer automaticly resuming with the next item in a listbox

Hi there,i'm having some trouble automaticly playing a list of audio files.

here's some of my code:

Private Sub AxWindowsMediaPlayer1_PlayStateChange(ByVal sender As Object, ByVal e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) Handles AxWindowsMediaPlayer1.PlayStateChange

Dim i As Integer

For i = 0 To Listplayname1.Items.Count - 1

If AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsMediaEnded Then

Listplayname1.SelectedIndex = i + 1

AxWindowsMediaPlayer1.URL = Listplayname1.SelectedItem

End If

Next i

End Sub

when a file ends it jumps to the next file in the list but it does not launch, anyone have a clue how to launch it if i click it or move up and down with the arrow keys it does launch. i would rather have it launch automaticly.

thanks in advance



Answer this question

axwindowsmediaplayer automaticly resuming with the next item in a listbox

  • Peer Larsen

    you may need to create a playlist instead and do it this way, take a look at th SDK about the playlists and how to use them

  • axwindowsmediaplayer automaticly resuming with the next item in a listbox