By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,687 Members | 2,055 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,687 IT Pros & Developers. It's quick & easy.

Reference to a form in another project

P: n/a
Hello,
My C# solution is composed of 2 projects, a class library project and a
Windows application project. The window in one project calls the DLL in the
other. That's ok.

Now, to better test the solution I would like to create a new Windows
application project in that solution so that my 2 other projects are not
impacted by this third project. Now this new project would contain the
startup Form from which I could open my Form in the previous project or call
the DLL directly.

My problem is that I don't know how to show a form from another project of
the solution since it is possible to add a reference to a project only for
DLLs.

Summary:
SolutionA contains
- Project1 (Form1)
- Project2 (DLL)
- Project3 (Form2)

How can I make Form2 opens Form1?

Thanks,
David.
Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hello David,

A dll project can contain a windows form. There is nothing wrong with that.
It is not trivial to change a Windows EXE project into a dll project. On
the other hand, it is quite easy to simply create a new DLL project and add
an Existing Item to it, and point to the windows form that you created for
your Windows EXE. Once you have all the code from the EXE project, then
simply delete the original project from your solution.

Now, you have two DLLs. When you add your new windows EXE, you can make a
reference to both.

--- Nick

"David Gagné" <ga*********@sympatico.ca> wrote in message
news:uN**************@TK2MSFTNGP09.phx.gbl...
Hello,
My C# solution is composed of 2 projects, a class library project and a
Windows application project. The window in one project calls the DLL in the other. That's ok.

Now, to better test the solution I would like to create a new Windows
application project in that solution so that my 2 other projects are not
impacted by this third project. Now this new project would contain the
startup Form from which I could open my Form in the previous project or call the DLL directly.

My problem is that I don't know how to show a form from another project of
the solution since it is possible to add a reference to a project only for
DLLs.

Summary:
SolutionA contains
- Project1 (Form1)
- Project2 (DLL)
- Project3 (Form2)

How can I make Form2 opens Form1?

Thanks,
David.

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.