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?
The Toolbox window displays controls that you can add to Visual Studio projects. To open Toolbox, choose View > Toolbox from the menu bar, or press Ctrl+Alt+X. You can drag and drop different controls onto the surface of the designer you are using, and resize and position the controls.
Reset the Toolbox from Visual Studio: right-click the Toolbox and click “Reset Toolbox”.
Check this setting:
Tools > Options > Windows Forms Designer > General : AutoToolboxPopulate
It should be set to True for this to work.
Build your project to make sure it compiles.
With the form that you want your user control on, open the toolbox, right click and select "choose items"
Browse to your .exe or dll that you compiled in step 1.
make sure that your user control has a tick next to it, press OK.
Your user control should appear in the toolbox, so drag it onto your form.
This is adapted from Calanus's answer to a similar question.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With