VB 如何实时知道Windows mediaplayer的播放状态,比如播放到第几秒了,至少得知道是否在播放,是否停止?
2个回答
展开全部
知道播放到第几秒的代码
Private Sub Form_Load()
Timer1.Interval = 500
End Sub
Private Sub Timer1_Timer()
Text1.Text = WindowsMediaPlayer1.Controls.currentPositionString
End Sub
知道是否在播放,是否停止的代码
Private Sub WindowsMediaPlayer1_PlayStateChange(ByVal NewState As Long)
If NewState = 1 Then Me.Caption = "停止"
If NewState = 3 Then Me.Caption = "正在播放"
End Sub
Private Sub Form_Load()
Timer1.Interval = 500
End Sub
Private Sub Timer1_Timer()
Text1.Text = WindowsMediaPlayer1.Controls.currentPositionString
End Sub
知道是否在播放,是否停止的代码
Private Sub WindowsMediaPlayer1_PlayStateChange(ByVal NewState As Long)
If NewState = 1 Then Me.Caption = "停止"
If NewState = 3 Then Me.Caption = "正在播放"
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询