Step9.撰???芊盼恢每刂瞥淌酱a
除需??xWindowsMediaPlayer.Ctlcontrols.currentPosioion做?傩灾档淖?更外,尚需利用AxWindowsMediaPlayer.currentMedia.duration去?定最大影片?度。
VB.NET
Private Sub tbarPlayLoaction_Scroll(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tbarPlayLoaction.Scroll
Me.AxWindowsMediaPlayer1.Ctlcontrols.currentPosition = tbarPlayLoaction.Value '改??芊盼恢?/SPAN>
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Me.AxWindowsMediaPlayer1.currentMedia Is Nothing Then
ReturnEnd If
Me.tbarPlayLoaction.Maximum = CInt(Me.AxWindowsMediaPlayer1.currentMedia.duration) '?定?芊盼恢谜{整Bar最大值
End Sub
C#
private void tbarPlayLoaction_Scroll(object sender, EventArgs e)
{this.axWindowsMediaPlayer1.Ctlcontrols.currentPosition = tbarPlayLoaction.Value; //改??芊盼恢?/SPAN>
}
private void timer1_Tick(object sender, EventArgs e)
{if (this.axWindowsMediaPlayer1.currentMedia == null)
return;this.tbarPlayLoaction.Maximum = (int)this.axWindowsMediaPlayer1.currentMedia.duration; //?定?芊盼恢谜{整Bar最大值
}
乐博网补充2段循环播放的代码:
第一种:
If axWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsStopped Then
axWindowsMediaPlayer1.Ctlcontrols.play()
End If
第二种:
axWindowsMediaPlayer1.settings.setMode("loop", True)
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/bofangqi/article-23780-4.html
真是幼稚