您的位置:首页 > 其它

WindowsMediaPlayer播放完毕可以播放下一个

2017-01-11 14:16 459 查看
if (e.newState = WMPLib.WMPPlayState.wmppsReady)

{

AxWindowsMediaPlayer1.Ctlcontrols.play();

}

如果是就表示以播放完毕可以播放下一个.

If e.newState = WMPLib.WMPPlayState.wmppsStopped Then
AxWindowsMediaPlayer1.URL = ListBox1.Items(index).ToString //index是你下一首的
AxWindowsMediaPlayer1.Ctlcontrols.play()

*******************************************************************************

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

If e.newState = WMPLib.WMPPlayState.wmppsStopped Then
If ListBox1.SelectedIndex = ListBox1.SelectedIndex - 1 Then
AxWindowsMediaPlayer1.Ctlcontrols.stop()
Else

ListBox1.SelectedIndex = ListBox1.SelectedIndex + 1
AxWindowsMediaPlayer1.URL = ListBox1.Items(ListBox1.SelectedIndex).ToString 'index是你下一首的

AxWindowsMediaPlayer1.Ctlcontrols.play()

End If
End If

End Sub

****************************************************************
https://social.msdn.microsoft.com/Forums/zh-CN/fb04d284-d167-4b4b-a610-dd87e1580592/listboxaxwindowsmediaplayer?forum=vbasiczhchs http://bbs.bccn.net/thread-132392-1-1.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: