Hi, I have to seperate C# projects!

Project 1 and project 2

Project 1 contains form1 and project 2 contains form2. What I did is, I have merged these two projects solution.

And I have created a button in form1, which when clicked opens form2 from project2.

When I compile these I get two .exe, one for form1 and one for form2. How to make it to only one .exe?

Is it possible?

Are both projects set up as 'Windows Forms' projects? One of them should be a 'Class Library' project, probably form2.

But is it possible if both are windows form project?

Yes. If you look at the code, you'll see that a form is just another class that inherits from System.Windows.Forms.Form. It doesn't matter what kind of project it's in. As long as one of your projects is a Windows Forms project and it references the other one, you'll be able to use them both.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.