kayleigh Posted November 16, 2003 Posted November 16, 2003 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? Quote
*Experts* mutant Posted November 16, 2003 *Experts* Posted November 16, 2003 (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 November 16, 2003 by mutant Quote
kayleigh Posted November 16, 2003 Author Posted November 16, 2003 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 :) Quote
Moderators Robby Posted November 16, 2003 Moderators Posted November 16, 2003 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 Quote Visit...Bassic Software
Administrators PlausiblyDamp Posted November 16, 2003 Administrators Posted November 16, 2003 (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 November 16, 2003 by PlausiblyDamp Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
*Experts* mutant Posted November 16, 2003 *Experts* Posted November 16, 2003 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? Quote
kayleigh Posted November 16, 2003 Author Posted November 16, 2003 Thanks to all of you for your help, it's ok now. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.