【发布时间】:2016-03-01 09:12:11
【问题描述】:
这是我的代码:
Private Sub AxWindowsMediaPlayer1_PlayStateChange(ByVal sender As System.Object, ByVal e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) Handles AxWindowsMediaPlayer1.PlayStateChange
If AxWindowsMediaPlayer1.playState = WMPPlayState.wmppsMediaEnded Then
Dim str As Integer
'the original lblPlayItemIndex.Text = 0 : the index of the first item in the listview
str = lblPlayItemIndex.Text + 1
AxWindowsMediaPlayer1.URL = fmPlaylist.lstPlaylist.Items(str).Tag
AxWindowsMediaPlayer1.Ctlcontrols.play()
MsgBox("str: " & str)
End If
End Sub
我有一个列表视图作为媒体播放器的播放列表.... 列表视图中每个项目的 .tag 是歌曲的路径
“lblPlayItemIndex.Text”是 listviewitem 的索引,当歌曲结束时...它将使“lblPlayItemIndex.Text”+1 以获取 listview 中的下一个项目
实际上我做得很好......但是当我关闭消息时歌曲停止播放的问题......
我的代码有什么问题吗....还是我应该用另一种方式来做??!!
【问题讨论】:
-
我已经编辑了你的标题。请参阅“Should questions include “tags” in their titles?”,其中的共识是“不,他们不应该”。
-
@John Saunders 抱歉 :)
标签: vb.net windows-media-player