简体   繁体   English

如何在Visual Studio 2010中向Windows窗体应用程序添加用户控件?

[英]How do I add a user control to a Windows Forms application in Visual Studio 2010?

如何在Visual Studio 2010中向Windows窗体应用程序添加用户控件?

You can try advice from How to put a UserControl into Visual Studio toolBox . 您可以尝试如何将UserControl放入Visual Studio工具箱中的建议 However, I had no success, but finally I found soulution. 但是,我没有成功,但最终我找到了解决方法。

My steps: 我的步骤:

  1. New Winforms Project (creates projects with Form1 included) 新的Winforms项目(创建包含Form1的项目)
  2. New User control (rebuild) 新用户控件(重建)
  3. Go to Solution Explorer and click 'Show All Files' on the toolbar. 转到解决方案资源管理器,然后单击工具栏上的“显示所有文件”。
  4. Expand Form1 and open Form1.Designer.vb (.cs) 展开Form1并打开Form1.Designer.vb(.cs)
  5. User Control is now in toolbox. 用户控件现在在工具箱中。

I have no explanation. 我没有解释

右键单击解决方案资源管理器中的项目,选择添加新的用户控件菜单项。

Got to: 前往:

Project at the topmenubar 顶部菜单中的项目

then 然后

pick the 2nd option: "add user control..." 选择第二个选项:“添加用户控件...”

type in a name for the user control u want and your done by clickin on OK 键入您想要的用户控件的名称,然后单击确定以完成操作

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

相关问题 如何将自定义Windows窗体控件添加到Visual Studio工具箱 - How to add a Custom Windows Forms Control into Visual Studio Toolbox 使用 PaintEventHandler - Visual C++ (Studio 2010) Windows Forms 应用程序 - Using PaintEventHandler - Visual C++ (Studio 2010) Windows Forms Application 如何在 Visual Studio 2019 中的 Windows Forms 应用程序中打印变量? - How do I print a variable in a Windows Forms Application in Visual Studio 2019? 应用程序Windows窗体,Visual Studio 2012 - Application Windows Forms, Visual Studio 2012 如何使Visual Studio的Windows窗体设计器不会删除控件? - How do I keep Visual Studio's Windows Forms Designer from deleting controls? 是否有任何理由切换到Visual Studio 2010 for Windows Forms开发? - Is there any reason to switch to Visual Studio 2010 for Windows Forms development? 如何在带有XNA的Visual Studio 2010中正确引用内容? - How do I properly reference Content in Visual Studio 2010 with XNA? 如何在 Visual Studio 2010 中引用 WPF 工具包? - How do I reference the WPF Toolkit in Visual Studio 2010? 如何在Visual Studio 2010中设置环境变量? - How do I set Environment Variables in Visual Studio 2010? 如何使用GUI在Visual Studio项目中而不是直接从Visual Studio添加和编译Windows窗体? - How to add and compile windows forms in Visual Studio project using a GUI, and not directly from Visual Studio?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM