简体   繁体   English

Visual Studio 2013缺少计时器工具

[英]Timer tool missing on visual studio 2013

I want to implement a timer, however the timer tool is missing when I check my toolbox. 我想实现一个计时器,但是当我检查工具箱时缺少计时器工具。 How can I attain the timer? 如何获得计时器?

If you're creating a WPF application, the timer is not anymore an UI element. 如果要创建WPF应用程序,则计时器不再是UI元素。 Instead you can use a DispatcherTimer . 相反,您可以使用DispatcherTimer

Use it like this: 像这样使用它:

DispatcherTimer dt = new DispatcherTimer(); 
dt.Tick += new EventHandler(dt_Tick);
dt.Interval = new TimeSpan(0, 0, 1); 
dt.Start(); 

Read more here . 在这里阅读更多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM