Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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?

  • *Experts*
Posted (edited)

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]

Edited by mutant
Posted

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 :)

  • Moderators
Posted

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...

dim fr2 as New Project2.form2

Visit...Bassic Software
  • Administrators
Posted (edited)

In the solution explorer add a reference to project2 and project3.

In form one you can then do

 

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.

Edited by PlausiblyDamp

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

  • *Experts*
Posted

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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...