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.
11 Answers
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.

- 3,249
- 3
- 24
- 42

- 6,529
- 6
- 25
- 20
-
37The key word here for me was "rebuild"... hadn't tried that, d'oh! Doing that alone sorted this for me. – Danny Beckett Jul 24 '13 at 00:47
-
2And, I had to re-open the solution after the rebuild – Jim Lahman Oct 31 '13 at 15:21
-
1In VS2012 they have now added the hint 'The current solution must be re-opened for this to take effect' to the options dialog. – Carlos P Nov 28 '13 at 20:08
-
It is does not work in Visual 2013 Studio for me :( My custom control from dll not showing in the toolbox – Anatolii Humennyi Apr 27 '14 at 14:07
-
2@AnatoliiGumennyi You will have to follow @Arseny's instruction if the `UserControl` is outside the current project. – Attacktive Feb 28 '15 at 14:57
-
2Note: Looks like in VS2013, the Toolbox > AutoToolboxPopulate setting now defaults to True on fresh install. – Curmudgeon Jun 18 '15 at 12:38
-
AutoToolboxPopulate + reopen solution = What a live saver :-) – Xan-Kun Clark-Davis Jul 06 '16 at 09:57
-
I am not sure what is meant by "select your assembly". I browse to the solution and end up selecting the exe file in the Debug folder. I get a message saying "The following controls were successfully added to the toolbox but are not enabled in the active designer. It shows my 2 UserContols in my solution in the list. Click OK The UserControls do not appear under Toolbox > General (VS 2015) – Al Lelopath Mar 20 '19 at 15:03
-
I renew the SO password just to upvote this answer. – Janaka R Rajapaksha Jun 19 '20 at 23:14
-
The setting was 'false' in VS2017. – R.J. Dunnill Jul 31 '20 at 00:05
Right-click on toolbar then click on "choose item" in context menu. A dialog with registered components pops up. in this dialog click "Browse" to select your assembly with the usercontrol you want to use.
PS. This assembly should be registered before.
-
18
-
He probably means that you have to put your usercontrols on a separated DLL and then add that DLL to the toolbox after building it. – Anes Hamdani Apr 26 '21 at 14:21
I found that the user control must have a parameterless constructor or it won't show up in the list. at least that was true in vs2005.

- 2,991
- 5
- 36
- 47
-
6
-
6
-
5
-
1It might "always" hold true if this is based on making an instance of the custom control, like how .NET serialization works. It can't do that if there is no parameterless constructor. – Jonas Apr 09 '19 at 09:01
-
Thank you! I spent half an hour tyring to get my control added to the toolbox and this was the answer – Tommy Nov 12 '21 at 21:46
Using VS 2010:
Let's say you have a Windows.Forms project. You add a UserControl (say MyControl) to the project, and design it all up. Now you want to add it to your toolbox.
As soon as the project is successfully built once, it will appear in your Framework Components. Right click the Toolbox to get the context menu, select "Choose Items...", and browse to the name of your control (MyControl) under the ".NET Framework Components" tab.
Advantage over using dlls: you can edit the controls in the same project as your form, and the form will build with the new controls. However, the control will only be avilable to this project.
Note: If the control has build errors, resolve them before moving on to the containing forms, or the designer has a heart attack.

- 151
- 1
- 2
-
1It could be also available to other projects if you import the .exe in the toolbox. – Sebastian Jun 29 '12 at 21:31
-
1
-
I did the same thing and it's all good, but when i moved the code into another project, create a dll, and reference the dll file, the custom control does not show up. – Fandi Susanto Dec 08 '14 at 09:18
I had many users controls but one refused to show in the Toolbox, even though I rebuilt the solution and it was checked in the Choose Items... dialog.
Solution:
- From Solution Explorer I Right-Clicked the offending user control file and selected Exclude From Project
- Rebuild the solution
- Right-Click the user control and select Include in Project (assuming you have the Show All Files enabled in the Solution Explorer)
Note this also requires you have the AutoToolboxPopulate option enabled. As @DaveF answer suggests.
Alternate Solution: I'm not sure if this works, and I couldn't try it since I already resolved my issue, but if you unchecked the user control from the Choose Items... dialog, hit OK, then opened it back up and checked the user control. That might also work.

- 8,149
- 3
- 35
- 31
There are a couple of ways.
In your original Project, choose File|Export template
Then select ItemTemplate and follow the wizard.Move your UserControl to a separate ClassLibrary (and fix namespaces etc).
Add a ref to the classlibrary from Projects that need it. Don't bother with the GAC or anything, just the DLL file.
I would not advice putting a UserControl in the normal ToolBox, but it can be done. See the answer from @Arseny

- 263,252
- 30
- 330
- 514
-
This seems the better approach. The only drawback is that you can't edit the control visually (or at least I didn't find how). – Sebastian Jun 29 '12 at 21:34
-
Nevermind, I added the template as element and the designer is showing. – Sebastian Jun 29 '12 at 21:52
-
I totally agree and would also strongly advise against linking to a DLL if the project that contains the UserControl is in the same solution. And it will work with a DLL, i.e. The UserControl in the Library Project will show up in any WinForms project that reference the library (after a rebuild, of course ;-) ). – Xan-Kun Clark-Davis May 13 '17 at 22:38
In my case, I couldn't see any of the controls in the project. Only when right clicking on toolBox and selecting "Show All" I saw them, but yet they were disabled...
Changing Project type from Windows application to ClassLibrary made the fix.

- 379
- 1
- 3
- 15
Basic qustion if you are using generics in your base control. If yes:
lets say we have control:
public class MyComboDropDown : ComboDropDownComon<MyType>
{
public MyComboDropDown() { }
}
MyComboDropDown will not allow to open designer on it and will be not shown in Toolbox. Why? Because base control is not already compiled - when MyComboDropDown is complied. You can modify to this:
public class MyComboDropDown : MyComboDropDownBase
{
public MyComboDropDown() { }
}
public class MyComboDropDownBase : ComboDropDownComon<MyType>
{
}
Than after rebuild, and reset toolbox it should be able to see MyComboDropDown in designer and also in Toolbox

- 11
- 1
The issue with my designer was 32 vs 64 bit issue. I could add the control to tool box after following the instructions in Cannot add Controls from 64-bit Assemblies to the Toolbox or Use in Designers Within the Visual Studio IDE MS KB article.

- 33,874
- 19
- 107
- 152

- 1
I just had this issue with VS 2022. There may be a quick/easy answer.
My quick and dirty user control would not appear in the toolbox (full rebuild etc.).
I quit the solutiuon and VS, reloaded all, rebuilt and it appeared and worked.

- 268
- 2
- 8