如何添加我的新用户控件工具箱或新的Winform? [英] How do I add my new User Control to the Toolbox or a new Winform?

查看:522
本文介绍了如何添加我的新用户控件工具箱或新的Winform?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有提供了一些的WinForms为善意,善意的Windows应用现有的库(不是WinForms应用程序)。在这个图书馆,我想创建一个用户控件将一些控件在一起。要做到这一点,我的右键点击,添加,用户控件并拖动了几个控件拖到新的用户控件。

I have an existing library (not a Winforms application) that supplies some Winforms to a bona-fide Windows application. Within this library, I would like to create a User Control to group some controls together. To accomplish this, I right-clicked, Add, User Control and dragged some controls onto the new User Control.

到目前为止,一切都很好。用户控件甚至有必要的用户控制图标。但是从Solution Explorer中的新的用户控件拖动到新的空白WinForm的不工作(我得到通过一条线一个圆圈),拖动到工具箱无法正常工作或(即使我得到一个+号当我将它拖到工具箱)。

So far, so good. The User Control even has the requisite User Control icon. But dragging the new User Control from the Solution Explorer to a new blank Winform does not work (I get a circle with a line through it), and dragging it over to the Toolbox doesn't work either (even though I get a + sign when I drag it over the Toolbox).

是否有某种神奇的XML或别的东西我失踪,使这项工作?

Is there some sort of XML magic or something else I'm missing to make this work?

注意:我有一些问题与Visual Studio 2008,我设法解决按照可以找到变通办法<一href=\"http://connect.microsoft.com/VisualStudio/feedback/details/363321/choose-items-in-toolbox-causes-visual-studio-2008-sp1-to-crash\">here.我现在能够通过简单地重建项目得到我添加到我现有的项目到工具箱的用户控件。

Note: I had some problems with Visual Studio 2008 that I managed to fix by following the workarounds that can be found here. I am now able to get User Controls I added to my existing project into the toolbox by simply rebuilding the project.

推荐答案

假设我明白你的意思:


  1. 如果你的用户控件是在库中,您可以将它添加到您的工具箱使用

  1. If your UserControl is in a library you can add this to you Toolbox using

工具箱 - >右键 - > 选择项目的 - > <大骨节病>浏览

Toolbox -> right click -> Choose Items -> Browse

用户控件选择您的程序集。

如果在用户控件是项目的一部分,你只需要来构建整个解决方案。在这之后,你的用户控件应该出现在工具箱中。

If the UserControl is part of your project you only need to build the entire solution. After that, your UserControl should appear in the toolbox.

一般情况下,是不可能从Solution Explorer中增加一个控制,只能从工具箱中。

这篇关于如何添加我的新用户控件工具箱或新的Winform?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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