Accessing multiple projects

Mark4321

New member
Joined
Oct 22, 2007
Messages
2
Programming Experience
Beginner
Hello,

I'm a new programmer. I've written what is for me a large application, and I did it in three different projects. Now I want to make them all into one solution and have the ability to access one project's controls from another project -- both part of the same shared solution. How do I do that?

I have tried File--Add Reference. And File--Add Existing Item. If I do Add existing item, what file of the many for a given project do I pick? Once I have added them, what's the syntax for accessing controls? Is it something like (from within project1).......project2.controls.button2 ??????

Thanks for any help you can offer.

Best Regards,

Mark
 
Each project compiles to an assembly file of its own, for Windows Application type project you get an .exe, for Class Library project you get a .dll. To access one assembly from another you Add Reference to it, with several projects within a solution you can select it in Projects tab of the dialog, else you browse to the compiled file. With the reference added you can access its objects by fully qualifying the classes by their namespace or just importing the namespace. Importing the namespace can also be done by going to Project properties, References tab and checking the namespaces you want globally imported for this project, all namespaces available from referenced assemblies are listed in a window here. All this works just the same as when your using .Net Framework library assemblies (which you do all the time) with the exception that .Net assemblies are registered in GAC and available to select from the .Net tab of Add Reference dialog.

Example Imports statement:
VB.NET:
Imports ClassLibrary2
Example fully qualifying a class object when there is no imports:
VB.NET:
Dim x As ClassLibrary2.SomeClass
 
Back
Top