如何在不在vb.net中添加dll的情况下将自我用户控件添加到工具箱中 [英] How to add self user control into toolbox without adding dll in vb.net

查看:250
本文介绍了如何在不在vb.net中添加dll的情况下将自我用户控件添加到工具箱中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不在vb.net中添加dll的情况下将自我用户控件添加到工具箱中

How to add self user control into toolbox without adding dll in vb.net

推荐答案

右键单击工具箱,选择选择项目,然后单击浏览在.NET Framework Components选项卡中,然后找到您的控件所在的.DLL并选择它。打开文件后,会将标题添加到列表中,您可以按名称空间对其进行排序,查找控件,并确保它们旁边有选中标记以选择它们。点击OK即可完成。
You right-click the Toolbox, pick Choose Items, click Browse in the .NET Framework Components tab, then go find the .DLL your control is in and select that. Once the file is opened, the conents will be added to the list where you can sort it by namespace, find your controls, and make sure they have checkmarks next to them to select them. Hit OK and you''re done.


如果您的用户控制代码在您的项目/解决方案中,则在编译解决方案时它将自动显示在工具箱中。



如果用户控件在外部程序集中,那么你必须引用该程序集以使其显示在工具箱中。



你仍然可以在外部程序集中使用usercontrol,即使它没有安装在工具箱中,但是你必须直接在项目中引用程序集并在代码中实现usercontrol(或者手动编辑设计器文件,这不是推荐)。



如果您告诉我们您想要这样做的原因,我们可能会为您提供更好的答案。
If your usercontrol code is in your project/solution, it will automatically show up in the toolbox when you compile the solution.

If the usercontrol is in an outside assembly, then you MUST reference that assembly to get it to show up in the Toolbox.

You can still use a usercontrol in an outside assembly even though it is not installed in the Toolbox, but then you MUST reference the assembly directly in the project and instanciate the usercontrol in code (or edit the designer file manually, which is not recommended).

If you let us know WHY you want to do this, we might be able to provide you with a better answer.

这篇关于如何在不在vb.net中添加dll的情况下将自我用户控件添加到工具箱中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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