473,387 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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?
Nov 20 '05 #1
5 6158
"Aaron Ackerman" <no@spam.com> 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

Nov 20 '05 #2

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" <no@spam.com> wrote in message
news:Oj**************@TK2MSFTNGP12.phx.gbl...
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?

Nov 20 '05 #3
* "Aaron Ackerman" <no@spam.com> 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>
Nov 20 '05 #4
Create a namespace for your solution and place all projects within it.
(remember, you can only reference objects that exist)

"Aaron Ackerman" <no@spam.com> wrote in message news:<Oj**************@TK2MSFTNGP12.phx.gbl>...
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?

Nov 20 '05 #5

"Aaron Ackerman" <no@spam.com> wrote in message
news:Oj**************@TK2MSFTNGP12.phx.gbl...
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
Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Sue | last post by:
After finishing up my first quarter JavaScript on 12/12/03, I decided to improve character checking on my project. In my project I only had to do very basic validation. Therefore, I only had one...
39
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
13
by: Lee Newson | last post by:
Hi, I have just written my first application using VB.NET. The app works fine when i am running it within .NET for debugging purposes, however when i try to run the app from the .exe file that...
4
by: Tony Johansson | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file called A One project that build a user control dll. Here we have a class called B One project...
5
by: Tony Johansson | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file called A One project that build a user control dll. Here we have a class called B One project...
1
by: .::alex::. | last post by:
Hello, I have an interesting question. I have an MDI App. The Child Windows are in different projects and namespaces according with his business logic. So, the "main" namespace contains the MDI...
2
by: teixeira1985 | last post by:
Hi , Due an unknown cause VS2005 started to show an error when i switch from code to design in windows forms projects. I repaired the installation but the same happens. The error is: One or...
9
by: =?Utf-8?B?VGVycnk=?= | last post by:
Hi, Is it possible (w/o generating a gazillion errors) to copy a form in VS 2005 so that it can be modified and reused. In other words, I have a form, alot of which I wish to use in a different...
2
by: =?Utf-8?B?SmltIE93ZW4=?= | last post by:
Hi John, Hopefully this post will find its way back to you - or perhaps be answered by someone else. As I mentioned in my last post on the earlier portion of this thread, changing the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.