I have some UserControls that I created in ProjectA. I have ProjectB that has a windows form that I want to put the controls on. Both of these projects are in a single solution. There's a reference to ProjectA from ProjectB so it can "see" the UserControls.
However, the UserControls do not show up in the toolbox for me to drag to the windows form.
I've tried rebuilding. I've also deleted the 'bin' directory to force a rebuild-all.
How do I get VS2008 to populate the toolbox with my UserControls?
Check project path, avoid & , # etc.
I've moved my solution from
drive:\work\c#\folder\
todrive:\work\folder
and it solved the problem.Usually you need to build the solution. That almost always works for me.
Another reason that user controls may not show up in the toolbox is if they do not have a default constructor.
Check your build output directory. If for some reason you are building your output somewhere other than the project bin\ directory, your controls won't show up in your toolbox.
It is possible for all of the above to fail.
I fixed it by creating a new user control (TestControl) and it triggered Visual Studio to magically add my project's controls tab + controls back into the Toolbox. Then I just deleted the test control.
This happened to me after recently installing a VS 2008 automated windows update, by the way.
Before trying to add a custom control, make sure that it is compatible with the .Net version of your current project.
I was trying to add a custom control to toolbox for a project for Windows CE 5.0 and .Net Compact v3.5 on VS2008. I did all those previous suggestions but nothing worked. The control shows up when "show all" is checked but it is grayed , even in "Choose Items" menu is checked.
I created a new project with .Net v2.0 and it worked perfectly.