请大家帮我看下怎样可以现实歌曲列表中上一首和下一首的选择
这是代码:Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub File1_Click()
If List1.ListCount = 0 Then
List1.AddItem Dir1.Path & "\" & File1.FileName '增加曲目到列表中
List1.ListIndex = 0
WindowsMediaPlayer1.URL = List1.Text '设置播放曲目
WindowsMediaPlayer1.Controls.play
Else
List1.AddItem Dir1.Path & "\" & File1.FileName '增加曲目到列表中
End If
End Sub
Private Sub List1_Click()
Text1.Text = List1.Text
End Sub
Private Sub MediaPlayer1_PlayStateChange(ByVal OldState As Long, ByVal NewState As Long)
'自动循环播放
If WindowsMediaPlayer1.Controls.stop Then
If List1.ListIndex < List1.ListCount - 1 Then
List1.ListIndex = List1.ListIndex + 1
WindowsMediaPlayer1.URL = List1.Text
WindowsMediaPlayer1.Controls.play
End If
End If
End Sub
Private Sub Command1_Click()
End
End Sub
Private Sub List1_DblClick()
WindowsMediaPlayer1.URL = List1.Text
WindowsMediaPlayer1.Controls.play
End Sub