Can I reference a Form to a Project the way I reference a Class to a Project?

CodyB

Active member
Joined
Jul 23, 2007
Messages
26
Programming Experience
3-5
I have built a custom Class that I encapsulate code in, and then I add the DLL reference to my Project.
I have started to make Custom Controls in the same DLL.
I now have several Projects that I have a common Form in each.
I've had to import a copy of the Form into each Project.
I would prefer to have one copy of the form and reference it, but I can't figure out how.
Is it even possible?
 
A form is a class like all other classes so you use it from class library the same way. You need a reference to the class library assembly, then you create a new instance of the class: dim x as new classlibrary1.form1
(a form in a class library is not included in the My.Forms collection of that was what you wondered about, those are local to the current assembly)
 
Super cool!

I sometimes get an error loading the designer component into the Class Library.
But I've been able to get around when it happens.

Thank you very much.
 
Back
Top