private sub Form_Load()
WindowsMediaPlayer1.URL = "music\排行榜.mp3"
WindowsMediaPlayer1.Controls.play
Timer1.Enabled = True
End sub
Private Sub Timer1_Timer()
If Me.WindowsMediaPlayer1.playState = 1 Then'1为停止播放
Me.WindowsMediaPlayer1.URL = "音乐文件地址"
Me.WindowsMediaPlayer1.Controls.play
End If
End Sub
注意要设置时间控件timer1的interval属性,可取20