简体   繁体   English

Visual Studio 2013 Express中的用户控件?

[英]User controls in Visual Studio 2013 Express?

I cant find Windows Forms Control Library in my projecttemplates or in the "online"-option? 我在我的项目模板或“在线”选项中找不到Windows窗体控件库? Is it renamed or simply not included in Express version? 它是否已重命名或不包含在Express版本中?

Edit: Maybe Class library is what Im searching for? 编辑:也许类库是我在寻找什么? I want to create a user control for winforms, but that class library dont recognize winforms components and I cant use 我想为winforms创建一个用户控件,但是该类库无法识别winforms组件,因此我无法使用

using System.Windows.Forms

Can I do a work around in class library? 我可以在类库中解决问题吗? Or do I need the full version of VS? 还是我需要完整版的VS?

From MSDN , you should be a able to find this option in Extensibility -> Installed templates. MSDN上 ,您应该能够在扩展性->已安装的模板中找到此选项。

In the New Project dialog box, under Installed Templates, expand the node for your preferred programming language and then select Extensibility. 在“新建项目”对话框的“已安装的模板”下,展开首选编程语言的节点,然后选择“可扩展性”。 In the list of project types, select Windows Forms Toolbox Control. 在项目类型列表中,选择“ Windows窗体工具箱控件”。

Class Library actually is what you need but it is better in your case to chose Winforms Program because that way all references are set up. 实际上是您需要的类库,但最好选择Winforms程序,因为这样可以设置所有引用。

When you have created it change it's project type to class library in the properties tab. 创建后,将其项目类型更改为属性选项卡中的类库

Note: The using clauses just make it simpler to reference the classes in the assemblies they refer to. 注意: using子句使引用它们所引用的程序集中的类变得更加简单。 But to get access to these they first must be added to your project's references. 但是要访问这些文件,首先必须将它们添加到项目的引用中。 Look at the project expolorer - references. 查看项目开发人员-参考。

The Windows Forms Template has all necessary assemblies already there while the Class Library Template doesn't and only has the bare minimum you need to write non-visual classes. Windows窗体模板已经具有所有必需的程序集,而类库模板则没有,并且只有编写非可视类所需的最低限度。

You can always add more references as needed with a right-click on the project explorer. 始终可以通过右键单击项目浏览器来根据需要添加更多引用。 Then you can navigate to the assemblies you need, like in your case System.Windows.Forms 然后,您可以导航到所需的程序集,例如System.Windows.Forms

And no, you don't need the full version for most things. 而且,大多数情况下您都不需要完整版本。

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

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