load form from different projects

paudelvikash

Member
Joined
Jun 30, 2007
Messages
8
Programming Experience
1-3
hi all
first i wish to know what does solution in vs 2003 means?
can i load a form belonging to one project from a form that belongs to another?
 
"Solution" can hold several projects that each is a separate assembly. For example you could have one windows application project and one class library project in the same solution. To use a class from a different project/assembly you must Add Reference from one to the other.
 
but how to load a form from differnt project
You add reference to the other assembly and use it like you use assemblies of the .Net Framework, that means once the reference is there you qualify the class type by namespace or add Imports statements as shortcuts. The namespace of the other assembly you find in its project properties where it says "Root Namespace", for example a default new class library project gets the assembly name and namespace set to "ClassLibrary1" (while you should give it a proper name). A form named "frmAbout" there could then be created like this:
VB.NET:
Dim f As New ClassLibrary1.frmAbout
is it good to keep all the application forms under same projects
If they are private to that project I'd say yes, if they are designed for re-use for different applications then keeping them in a Class Library project is appropriate.
 
Back
Top