0

I have created a custom UserControl in a vb.net Class Library project, and I would like to Build this library and be able to reference the .dll file from other projects in order to re-use the custom UserControl.

When I Build the Class Library project and add its .dll to a Windows Form Application project as a reference, I do not see my custom UserControl in the ToolBox. I have a feeling it has something to do with the fact that the code I've written for the UserControl is separate from the code the designer automatically creates when I design the control in design mode.

I've been searching the web for a few days no to no avail. I see similar answers for ASP.net UserControls, but have been unable to transfer those answers over to the vb.net platform.

Any help is greatly appreciated.

  • There are some solutions you can try [here](http://stackoverflow.com/questions/4621558/visual-studio-do-not-add-my-component-from-a-dll-to-the-toolbox-even-if-i-refe) – soohoonigan Sep 30 '16 at 20:39
  • The very first solution in your link worked for me. I can't believe I wasn't able to find it on my own - I've been searching for "UserControl" rather than "component", and never came across this. Thank you very much for your help. – user3613310 Sep 30 '16 at 20:44
  • That is not how it is done. Remove the reference again. Right-click the toolbar, click Choose Items... Click the Browse button and select the DLL of your UserControl project. I would recommend using a project reference instead, easier to ensure that everything is hunky-dory in source control and you can still open your project 3 years from now. – Hans Passant Sep 30 '16 at 20:45
  • Hans Passant that's exactly what I did (Right-click toolbox, click Choose Items, Click Browse, and select the .dll). What do you mean when you say "I would recommend using a project reference instead, easier to ensure that everything is hunky-dory in source control and you can still open your project 3 years from now." When I only add a reference to the .dll in my project, my UserControl does not show up in the ToolBox until I do the Right-Click in the ToolBox, go to Choose Items, click browse, and select the .dll – user3613310 Sep 30 '16 at 20:52
  • [How to add a custom WinForm control into VS 2013 Toolbox as a default control?](https://stackoverflow.com/questions/36097875) – Reza Aghaei Sep 30 '16 at 21:00

1 Answers1

-2

• Right-click in the toolbox.

• Click "Choose Items..."

• Click "Browse..."

• Navigate to your DLL and click Open

• Then click "Ok"

Your components should then show up