How to put a UserControl into Visual Studio toolBox

Saeed picture Saeed · Aug 10, 2010 · Viewed 146.1k times · Source

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.

Answer

DaveF picture DaveF · Nov 17, 2011

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!

Go to Tools > Options > Windows Forms Designer > General

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 they user controls in you solution should be automatically added to the toolbox. You might have to reload the solution as well.