1. 程式人生 > >WPF 定時器

WPF 定時器

sta start class color wpf patch 執行 star div

//定時查詢-定時器
 DispatcherTimer dispatcherTimer = new DispatcherTimer();
 dispatcherTimer.Tick += (s, e) =>
 {
  //你要執行的代碼
  };
 dispatcherTimer.Interval = new TimeSpan(0, 0, 1);//每隔一秒刷新
 dispatcherTimer.Start();

WPF 定時器