读书人

播放器 WindowsMediaPlayer1 +Listbo

发布时间: 2012-02-03 22:02:47 作者: rapoo

播放器 WindowsMediaPlayer1 +Listbox 如何自动播放下一首

VB code
Private Sub Form_Load()On Error Resume NextIf App.PrevInstance Then End If Dir(App.Path & "\tem.txt") <> "" Then   Open App.Path & "\tem.txt" For Input As #1     Do Until EOF(1)       Input #1, a$, B$         Form2.L.AddItem Format(Form2.L.ListCount + 1, "000") & ". " & Trim(a$)   '歌名                  Form2.List1.AddItem Trim(B$)   ' 将文件路径读入 隐藏的播放列表            Loop      Close End IfEnd Sub


以上是加载歌名和路径 用了两个listbox

怎么才能让播放完后自动播放下一首歌呢?




[解决办法]
VB code
Private Sub Timer1_Timer()                 If MP.playState = 1 Then                     Song = Song + 1: Form2.L.ListIndex = Song            url = Form2.List1.List(Form2.L.ListIndex)             WindowsMediaPlayer1.url = url: WindowsMediaPlayer1.Controls.play               end if End Sub 

读书人网 >VB

热点推荐