一、注意事项

引用命名空间:System.Windows.Threading.DispatcherTimer。

二、使用方法

var _timer = new DispatcherTimer();
_timer.Interval = new TimeSpan(0, 0, 1);   //间隔1秒
_timer.Tick += new EventHandler(Timer_Tick);
_timer.Start();
private void Timer_Tick(object sender, EventArgs e)
{
        dTimer.Stop();//先停止定时器的作用
}

 

一、注意事项

引用命名空间:System.Windows.Threading.DispatcherTimer。

二、使用方法

var _timer = new DispatcherTimer();
_timer.Interval = new TimeSpan(0, 0, 1);   //间隔1秒
_timer.Tick += new EventHandler(Timer_Tick);
_timer.Start();
private void Timer_Tick(object sender, EventArgs e)
{
        dTimer.Stop();//先停止定时器的作用
}

 

相关文章:

  • 2022-12-23
  • 2022-02-01
  • 2022-12-23
  • 2021-11-29
  • 2021-12-17
  • 2022-12-23
猜你喜欢
  • 2021-09-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-17
  • 2021-11-07
相关资源
相似解决方案