WPF 中定时器的使用

时间:2017-07-07 13:53:53   收藏:0   阅读:437
DispatcherTimer timer;

private void Window_Loaded(object sender, RoutedEventArgs e)
{
    timer = new DispatcherTimer();
    timer.Interval = TimeSpan.FromMilliseconds(64);
    timer.Tick += timer1_Tick;
    timer.Start();
}

private void timer1_Tick(object sender, EventArgs e)
{
    //定时执行的内容
}

只是记录一下写过的代码,后面忘记的时候可以来看看,就不多做描述了!!!

原文:http://www.cnblogs.com/mr-yoatl/p/7131784.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!