windowsmediaplayer连续自动播放时出错
代码如下:Private Sub Wmp_PlayStateChange(ByVal NewState As Long)
If Wmp.playState = wmppsMediaEnded Then
If List1.ListIndex < List1.ListCount - 1 Then
List1.ListIndex = List1.ListIndex + 1
Text1.Text = List1.Text
Wmp.URL = List1.Text
wmp.controls.play
Else
List1.ListIndex = 0
Wmp.URL = List1.Text
Wmp.Controls.play
End If
End If
End Sub
按上面的代码运行,第二首歌不自动播放,非得按"播放"键才播放.
把上面wmp.controls.play改成wmp.setting.autoplay=true也不行
奇怪的是改成wmp.controls=play就正常播放了,但程序老在这一行报错:
"此对象不支持该属性或方法"
真是纳了闷了.