Search code examples
c#winformsvisual-studio-2010toolbox

How to put a UserControl into Visual Studio toolBox


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.


Solution

  • 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, the user controls in your solution should be automatically added to the toolbox.

    You might have to reload the solution as well.