solution with many projects

kayleigh

Newcomer
Joined
Sep 25, 2003
Messages
6
Location
Barcelona
Hi guys,
My problem is: I have a solution with several projects on it. Let's say one of them is my "main" project. I'd like to reference forms that belong to different projects from this main form, but I can't find the way.
Can someone give me a clue, please?
 
If all your projects are exes then you cant reference them. If one is exe and other DLL then you could reference the DLL from the exe one.
[edit]Misspelled one word which changed the whole meaning of my post :)[/edit]
 
Last edited:
Sorry, maybe I didn't explain clearly, or from your answer I can't get what to do.

I have project1, project2 and project3, form1 in project1, form2 in project2 and form3 in project3. I want to be able to have in form1:

dim fr2 as New form2
dim fr3 as New form3
fr2.show
fr3.show

Right now, I don't see how to do this in form1, where I only can reference elements that belong to project1.

Thanks in advance :)
 
You need to Add a Reference to the other projects, and if you don't add them as Imports at the top of your code page then you will need to fully-qualify them during your declaration, ie...
Visual Basic:
dim fr2 as New Project2.form2
 
In the solution explorer add a reference to project2 and project3.
In form one you can then do

Visual Basic:
dim f2 as new Project2.Form2()    'You may need to replace Project2 with the real namespace of the project
dim f3 as new Project2.Form2()
f2.Show()
f3.Show()

edit : robby beat me to it.
 
Last edited:
I made a typo in my first post, what I meant to say is that you cant reference an EXE from an EXE (my post is corrected now).
So are your projects all EXEs or do you have DLLs?
 
Back
Top