如何把一个用户控件到Visual Studio工具箱 [英] How to put a UserControl into Visual Studio toolBox

查看:542
本文介绍了如何把一个用户控件到Visual Studio工具箱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目做了一个用户控件,并建立项目后,我需要把它放在我的工具箱,并把它作为一个普通的控制。但我不能。该用户控件是在我的项目命名空间中,我试图在选择右键菜单项,但我没有找到一个方法来添加。

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 rightclick menu, but I didn't find a way to add it.

推荐答案

我假设你正在使用VS2010(也就是你标记过什么问题的)
我只好让他们到工具箱中自动添加为VS2008 / 2005的问题。
实际上,有一个选项,以停止工具箱自动填充!

I'm assuming you're using VS2010 (that's what you've tagged the question as) 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。设置这是真的,然后重建您的解决方案。

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.

嘿你的解决方案preSTO他们的用户控件应该会自动添加到工具箱。
您可能需要重新加载的解决方案也是如此。

Hey presto they user controls in you solution should be automatically added to the toolbox. You might have to reload the solution as well.

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

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