类中的System.Windows.Forms [英] System.Windows.Forms in class

查看:118
本文介绍了类中的System.Windows.Forms的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

回到.net 2,我可以在类中使用System.Windows.Forms;.现在我正在使用vs 2010,看来我不能使用
using System.Windows.Forms;放在一个类中.这是由于业务需求.

在.net 4中可以吗?

如果您无法使用 System.Windows添加

  .Forms; 


到类,则根本原因是您的项目未在引用中引用System.Windows.Forms.

添加所需的引用,然后它将正常工作,并且不会出现编译器错误.


您需要将引用添加到System.Windows.Forms


Back in .net 2 I was able to use System.Windows.Forms; inside a class. Now I am using vs 2010 and it seems I can not use
using System.Windows.Forms; inside a class. This is due to a business requirement.

Is this possible in .net 4?

Thanks

解决方案

If you are unable to add

using System.Windows.Forms;


to a class then the root cause is that your project has not referenced System.Windows.Forms in the references.

Add the references you need then it should work and you won''t get compiler errors.


You need to add the reference to System.Windows.Forms


这篇关于类中的System.Windows.Forms的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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