Link to user controls contained in one VB.NET project

I apologize if this post is a duplicate, but I did not find anything like this when searching.

I am new to VB.NET, and now I play with user controls, figuring out good programming methods. As far as I understand, to create and use UserControl I need to create a project using UserControl in it, then create a project and use this DLL (add it to the toolbar or otherwise).

My question is this: is there a way to have a project (a form with a bunch of things on it) that contains a UserControl written in a * .vb file inside the same project? If you do this, the DLL (in my case) will never be produced, perhaps because UserControl is never used, and its creation is simply skipped. Perhaps this is bad practice? It just makes sense for me to keep UserControl as part of a project that uses it uniquely. Is there any reason not to do this?

Thanks in advance! =)

SOLUTION: Visual Studio does not automatically include your own controls in the toolbar! To change this, go to Tools> Options> Windows Form Designer> General and set AutoToolboxPopulate to True . The next time you create your project, your new control will appear in the toolbar.

+4
source share
1 answer

This is the right design solution, including UserControl in a WinForm or WPF project that uses it. If you do this, VS will not create a DLL for UserControl; instead, UserControl will be embedded in the assembly that your project creates.

If you want to reuse UserControl in several projects, you need to create a separate project that generates a DLL that can be reused.

+2
source

Source: https://habr.com/ru/post/1341329/