PC Review


Reply
Thread Tools Rate Thread

How do I call a Form in a different project but in the same solution???

 
 
Aaron Ackerman
Guest
Posts: n/a
 
      11th Dec 2003
I have a form that I need to call that is in it's own project in the SAME
solution and I am at a loss.
So what I am trying to do is call Form1 in Project 1 from Form2 in Project2.

How do I do this??? I can't see it?


 
Reply With Quote
 
 
 
 
Armin Zingler
Guest
Posts: n/a
 
      11th Dec 2003
"Aaron Ackerman" <(E-Mail Removed)> schrieb
> I have a form that I need to call that is in it's own project in the
> SAME solution and I am at a loss.
> So what I am trying to do is call Form1 in Project 1 from Form2 in
> Project2.
>
> How do I do this??? I can't see it?


In the solution explorer, right-click on "references", select "add". In the
opened dialog, open tab "projects". There you can set the reference to the
class libraries in the same solution.


BTW, please post only to the appropriate groups!


--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

 
Reply With Quote
 
Azhagan
Guest
Posts: n/a
 
      11th Dec 2003

Though you have your two projects under one solution, how are they
related? You cannot relate (add a reference) from one exe to another exe.
I assume one of the projects (Project2) is a DLL in which case, you can call
the form from second project by creating an instance of it. Like so,

Project2.Form2 objForm = new Project2.Form2(); // assuming
Project2 is the default namespace for Project2.
objForm.Show();

Having a userinterface in DLLs is not recommended since if you are
hosting them under COM+, they might pop this screen up. A better approach
would be to log those messages to your own logging mechanism or to windows
event log.

Hope this helps.
-Azhagan.


"Aaron Ackerman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have a form that I need to call that is in it's own project in the SAME
> solution and I am at a loss.
> So what I am trying to do is call Form1 in Project 1 from Form2 in

Project2.
>
> How do I do this??? I can't see it?
>
>



 
Reply With Quote
 
Herfried K. Wagner [MVP]
Guest
Posts: n/a
 
      11th Dec 2003
* "Aaron Ackerman" <(E-Mail Removed)> scripsit:
> I have a form that I need to call that is in it's own project in the SAME
> solution and I am at a loss.
> So what I am trying to do is call Form1 in Project 1 from Form2 in Project2.


The type of the other project must not be an Executable project (use a
class library instead). Then you can reference this project (have a
look at the other project's context menu in the solution explorer) and
use the classes.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
 
Reply With Quote
 
Charlie Smith
Guest
Posts: n/a
 
      11th Dec 2003
Create a namespace for your solution and place all projects within it.
(remember, you can only reference objects that exist)

"Aaron Ackerman" <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>...
> I have a form that I need to call that is in it's own project in the SAME
> solution and I am at a loss.
> So what I am trying to do is call Form1 in Project 1 from Form2 in Project2.
>
> How do I do this??? I can't see it?

 
Reply With Quote
 
Tony Dong
Guest
Posts: n/a
 
      16th Dec 2003

"Aaron Ackerman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> I have a form that I need to call that is in it's own project in the SAME
> solution and I am at a loss.
> So what I am trying to do is call Form1 in Project 1 from Form2 in

Project2.
>
> How do I do this??? I can't see it?
>
>


Go to property for Project2, and set up output type to class libary, make a
reference from project1, and then your will see it will be works.

Tony


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
1 solution, 2 projects: how to use function form project B into project A unknown; Microsoft VC .NET 2 18th Dec 2006 07:13 PM
call function from one project to another in a single solution Amit Microsoft VC .NET 2 5th Jul 2006 04:39 PM
Multi-Project solution - how to show form from other project. Gary Kahrau Microsoft VB .NET 3 3rd Dec 2004 06:01 PM
How to call a exe from another project in the same solution?? Vanessa Microsoft VB .NET 1 8th Jul 2003 09:58 PM
How to call a exe from another project in the same solution?? Vanessa Microsoft Dot NET 2 8th Jul 2003 09:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:16 AM.