我有以下代码:http://pastebin.com/EgjbzqA2基本上只是http://www.dreamincode.net/forums/topic/57357-mymusic-player/的精简版。我希望程序重复播放一个文件,但是,由于某种原因,此功能不起作用。程序播放每个文件一次然后停止。
Private Sub Player3_PlayStateChange(ByVal NewState As Integer) Handles Player3.PlayStateChange
Static Dim PlayAllowed As Boolean = True
Select Case CType(NewState, WMPLib.WMPPlayState)
Case WMPLib.WMPPlayState.wmppsReady
If PlayAllowed Then
Player3.controls.play()
End If
Case WMPLib.WMPPlayState.wmppsMediaEnded
' Start protection (without it next wouldn't play
PlayAllowed = False
' Play track
Player3.controls.play()
' End Protection
PlayAllowed = True
updatePlayer()
End Select
End Sub