本文介绍了VS 2017工具箱缺少计时器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 尽管我努力,但无法找到计时器控制。在"WPF组件"中没有可见的。或者。Timer control is nowhere to be found despite my efforts. There is no visible in "WPF components" either.帮助!推荐答案 请参阅您的描述,我想您当前的项目类型是WPF。据我所知,没有这样的Timer控件,它应该是 DispatcherTimer 它不是一个控件但在代码中使用,它基本上像Windows窗体应用程序中的Timer控件一样工作,请看看 这个类似问题。Refer to your description, I suppose your current project type is WPF. As far as I know, there is no such Timer control and it should beDispatcherTimer which is not a control but used in code, it basically works like the Timer control in the Windows Forms application, please have a look atthis similar issue. 使用 System 。 Windows 。 线程 ; DispatcherTimer dispatcherTimer = new 系统 。 Windows 。 线程 。DispatcherTimer(); DispatcherTimer dispatcherTimer = newSystem.Windows.Threading.DispatcherTimer(); dispatcherTimer.Tick + = new EventHandler(dispatcherTimer_Tick); dispatcherTimer.Tick +=new EventHandler(dispatcherTimer_Tick); dispatcherTimer.Interval = new TimeSpan(0,0,1); dispatcherTimer.Interval = new TimeSpan(0, 0, 1); dispatcherTimer.Start(); dispatcherTimer.Start(); 私人 void dispatcherTimer_Tick( object sender ,EventArgs e ) privatevoid dispatcherTimer_Tick(objectsender, EventArgse) { { //代码 } } 希望上述信息对您的问题有所帮助,有关WPF开发的更多问题,请转到此WPF支持论坛: https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wpf 寻求更好的支持,谢谢你的理解。Hope the above information is helpful for your issue, for more WPF development issues and please redirect to this WPF support forum:https://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wpf to seek for a better support, thank you for your understanding. 最好的问候, Sara 这篇关于VS 2017工具箱缺少计时器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-20 06:28