C#wmp循环播放触发time控件
我用wmp控件播放视频 通过视频的时间触发time控件 我现在需要这个视频循环播放 但是这个time控件只会在第一次播放的时候触发 我该怎么做呢?这是我的time事件
private void timer1_Tick_1(object sender, EventArgs e)
{ //根据播放进度开关灯
if (Convert.ToInt32(axWindowsMediaPlayer1.Ctlcontrols.currentPosition) == Convert.ToInt32(timervalue))
{
if (timervalue == Static_Value.Timer1)
{
timer1.Enabled = false;
if (OpenOff == false)
{
OpenOff = true;
}
else
{
OpenOff = false;
}
cc.JianBian(5,OpenOff);
MessageBox.Show("开");
timervalue = Static_Value.Timer2;
timer1.Enabled = true;
return;
}
if (timervalue == Static_Value.Timer2)
{
timer1.Enabled = false;
if (OpenOff == true)
{
OpenOff = false;
}
else
{
OpenOff = true;
}
cc.JianBian(5, OpenOff);
MessageBox.Show("关闭灯");
timervalue = Static_Value.Timer3;
timer1.Enabled = true;
return;
}
}
}
//视频一循环播放
private void axWindowsMediaPlayer1_PlayStateChange(object sender, AxWMPLib._WMPOCXEvents_PlayStateChangeEvent e)
{
if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsStopped)
{
this.axWindowsMediaPlayer1.Ctlcontrols.play();
timer1.Start();
}
} 控件 c#
补充:VB , 控件