如何在我的c#项目中添加计时器 [英] how do I add a timer to my c# project

查看:479
本文介绍了如何在我的c#项目中添加计时器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

七年前我使用的是C#2010而刚刚进入2017年,现在我正在尝试为我的项目添加一个计时器,我无法在工具箱中找到它并且我无法添加对system.windows.forms的引用,因为它告诉我添加对.Net的引用,但我不知道
在哪里找到.Net?!?





我的代码是完美的,直到我找不到错误

解决方案

您好, 


您的解释听起来很奇怪。


我有2010年&尝试使用2017年 - 现有项目没有问题。


对于新项目 - 需要注意选择的内容 - 有很多新项目。检查项目文件中的项目类型ID。


当有合适的元素要使用时,会出现工具箱。例如,当您在设计模式下使用Form时,可以使用可视/表单组件。


并且......您仍然可以选择在代码中创建计时器:

 System.Windows.Forms.Timer timmer = new System.Windows.Forms.Timer(); 


I was using C#2010 seven years ago and just got the 2017, now I'm trying to add a timer to my project and I can't find it in the toolbox and I can't add a reference to system.windows.forms because it tells me to add a reference to .Net but I don't know where to find .Net?!?


my code is perfect until i don't find a bug

解决方案

Hello, 

Your explanation sound weird.

I have 2010 & try to use 2017 - there was no problem on existing projects.

For new project - need to pay attention to what are chosen - there a are a lot of new projects. Check the project type ID in project file.

Toolbox are appear when there is suitable element to be used. For example - visual/form components are available when you have Form in design mode.

And... you still have option to create timer in the code:

System.Windows.Forms.Timer timmer = new System.Windows.Forms.Timer();


这篇关于如何在我的c#项目中添加计时器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆