Question How would I correctly call a form from a different project in the same solution?

techwiz24

Well-known member
Joined
Jun 2, 2010
Messages
51
Programming Experience
Beginner
I can have all the projects existing in the same solution, and it builds fine. I can have a reference added to the project that I want to show a form from and still builds fine, every time I do something like this:
VB.NET:
Dim form_to_show as new Project2.Form1
form_to_show.show()
It appears to corrupt the RESX file and stops compiling...it's really getting anoying...any suggestions?
 
OK, so now it's doing different things :( now, whenever I add a reference to the project, I get an error saying "Could not locate file or assembly" in the RESX file for the main form (the one that calls the second project). As soon as I take away that reference, everything's all happy except that now I have no way of calling my second project :(
 
Is the 2nd project a WinForms app? If so then you'd need to run the 2nd project's exe file (you can use Process.Start() for that)

In if it's not a Winforms app, then what kind of project is it?
 
Sort of, you need to specify the exact path & the file name of the project's exe file, keep in mind that when deployed the file path will probably be different.
 
Well think about it, you're wanting to open a form in another WinForms project, which means that program has to be running as well.

I wonder if you should move that form to a dll project and use that dll in both projects, but I dont know what the projects are or how they relate to each other.
 
Back
Top