![]() |
#2
xzlxzlxzl2017-02-01 22:01
|
(注:我曾经在有效的钟中把controls.currentPosition=currentMedia.duration作为判断依据,但是歌曲播放完成以后无法执行条件。代码如下:)

If WMP1.currentMedia.duration = WMP1.Controls.CurrentPosition And WMP1.currentMedia.duration <> 0 Then
Select Case PlayMode
Case 1 '单曲循环
Call PlayMusic(PlayNowIndex)
Case 2 '全部循环
Call Picture3_Click
Case 3 '顺序播放
If PlayNowIndex = List1.ListCount Then
'最后一首歌曲
WMP1.Controls.Stop
Label2.Caption = "00:00/00:00"
Else
'不是最后一首歌曲
Call Picture3_Click
End If
Case 4 '随机播放
Dim RandIndex As Long
Randomize
RandIndex = Int(Rnd * List1.ListCount) + 1
Call PlayMusic(RandIndex)
Debug.Print "RandIndex=" & RandIndex
End Select
End If
Select Case PlayMode
Case 1 '单曲循环
Call PlayMusic(PlayNowIndex)
Case 2 '全部循环
Call Picture3_Click
Case 3 '顺序播放
If PlayNowIndex = List1.ListCount Then
'最后一首歌曲
WMP1.Controls.Stop
Label2.Caption = "00:00/00:00"
Else
'不是最后一首歌曲
Call Picture3_Click
End If
Case 4 '随机播放
Dim RandIndex As Long
Randomize
RandIndex = Int(Rnd * List1.ListCount) + 1
Call PlayMusic(RandIndex)
Debug.Print "RandIndex=" & RandIndex
End Select
End If