如何将 UserControl 放入 Visual Studio 工具箱

编程入门 行业动态 更新时间:2024-10-24 21:35:56
本文介绍了如何将 UserControl 放入 Visual Studio 工具箱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在我的项目中做了一个用户控件,构建项目后,我需要把它放在我的工具箱中,并将其用作通用控件.但我不能.UserControl 在我的项目命名空间中,我在右键菜单中尝试了 Choose Item,但没有找到添加它的方法.

I made a usercontrol in my project, and after building project, I need to put it in my toolbox, and use it as a common control. but i can't. the UserControl is in my project namespace, and I tried Choose Item in right click menu, but I didn't find a way to add it.

推荐答案

我在让它们像在 VS2008/2005 中一样自动添加到工具箱时遇到了问题.

I had problems getting them to add automatically to the toolbox as in VS2008/2005.

实际上有一个选项可以停止工具箱自动填充!

There's actually an option to stop the toolbox auto-populating!

转到工具>选项 >Windows 窗体设计器 >一般

Go to Tools > Options > Windows Forms Designer > General

在列表底部,您会找到工具箱 >AutoToolboxPopulate 在全新安装时默认为 False.将其设置为 true,然后重新构建您的解决方案.

At the bottom of the list, you'll find Toolbox > AutoToolboxPopulate which on a fresh install defaults to False. Set it true and then rebuild your solution.

您好,您的解决方案中的用户控件应该会自动添加到工具箱中.

Hey presto, the user controls in your solution should be automatically added to the toolbox.

您可能还需要重新加载解决方案.

You might have to reload the solution as well.

更多推荐

如何将 UserControl 放入 Visual Studio 工具箱

本文发布于:2023-11-17 05:23:27,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1608977.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:工具箱   如何将   放入   UserControl   Visual

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!