WPF 中定時器的使用


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)
{
    //定時執行的內容
}

只是記錄一下寫過的代碼,后面忘記的時候可以來看看,就不多做描述了!!!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM