播放器 WindowsMediaPlayer1 +Listbox 如何自动播放下一首
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
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