I am rather new to C# and I this is probably much easier than I am making it. I am trying to have 1 project call and run another project. Also, I am having issues with 1 form trying to open another form.
If the projects are in the same Solution - then you have to build one as a Class Library (Right click on the project, go to properties, and it's within the build options)
Then on your main project go to references -> Add Reference and click on the Projects tab. Select the other project (the one that is now a class library) and click ok.
At the top of the class where you want to use this project add
using YourClassLibraryProjectName;
and you can now use all the items from that project that are set to public. If you are using the 2.0 Framework and VisualStudio 2005 - keep in mind that all classes start with
class MyClass
{
}
and to use them in theother project you need to make them
public class MyClass
{
}
As for opeing another form you will want to consider the Model-View-Controller design pattern and the Observer pattern.
Basically, Your forms don't really talk to eachother directly. Instead they talk to a class that both are aware of (the controller) and when there is a change that will affect both forms, the controller will notify each of the forms (the views).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.