Option Explicit Dim mp3List() As String '用此数组来实现播放列表 Private IndexOfList As Long '播放指示器 Private Sub buttonNext_Click() '下一首 IndexOfList = IndexOfList + 1 If IndexOfList > UBound(mp3List) Then IndexOfList = 0 PlayList End SubPrivate Sub buttonPrevious_Click() '上一首 IndexOfList = IndexOfList - 1 If IndexOfList < 0 Then IndexOfList = UBound(mp3List) PlayList End SubPrivate Sub Form_Load() ReDim mp3List(5) As String '实例化列表 mp3List(0) = "F:\Media\20049212028154.mp3" mp3List(1) = "F:\Media\Aurora.mp3" mp3List(2) = "F:\Media\jiangnan.mp3.mp3" mp3List(3) = "F:\Media\littlebird.mp3" mp3List(4) = "F:\Media\Super Star.mp3" mp3List(5) = "F:\Media\sunyanzi_17.mp3" IndexOfList = 0 PlayList End SubPrivate Sub PlayList() '播放IndexOfList指示器指定的歌曲 MediaPlayer1.FileName = mp3List(IndexOfList) End Sub'实现自动循环播放 Private Sub MediaPlayer1_PlayStateChange(ByVal OldState As Long, ByVal NewState As Long) If NewState = 0 Then buttonNext_Click End Sub
Dim mp3List() As String '用此数组来实现播放列表
Private IndexOfList As Long '播放指示器
Private Sub buttonNext_Click() '下一首
IndexOfList = IndexOfList + 1
If IndexOfList > UBound(mp3List) Then IndexOfList = 0
PlayList
End SubPrivate Sub buttonPrevious_Click() '上一首
IndexOfList = IndexOfList - 1
If IndexOfList < 0 Then IndexOfList = UBound(mp3List)
PlayList
End SubPrivate Sub Form_Load()
ReDim mp3List(5) As String '实例化列表
mp3List(0) = "F:\Media\20049212028154.mp3"
mp3List(1) = "F:\Media\Aurora.mp3"
mp3List(2) = "F:\Media\jiangnan.mp3.mp3"
mp3List(3) = "F:\Media\littlebird.mp3"
mp3List(4) = "F:\Media\Super Star.mp3"
mp3List(5) = "F:\Media\sunyanzi_17.mp3"
IndexOfList = 0
PlayList
End SubPrivate Sub PlayList() '播放IndexOfList指示器指定的歌曲
MediaPlayer1.FileName = mp3List(IndexOfList)
End Sub'实现自动循环播放
Private Sub MediaPlayer1_PlayStateChange(ByVal OldState As Long, ByVal NewState As Long)
If NewState = 0 Then buttonNext_Click
End Sub
不过我要的是windowsMediaPlayer的实现方法
能不能告诉我啊!
在代码中 写入控件的名称,比如 windowsMediaPlayer
然后输入 . 看看后面的属性或者方法哪个比较像,就试一试。注意,属性后面还可能有子属性。我曾经这么试过,并且试出来了需要的东西
VB里我试了一次,也是可以的!!!
我再试一下,发出代码!