Malinda Peiris Malinda Peiris - 13 days ago 5
C# Question

Visual studio running a relevant form

I have three forms in C# Visual Studio. When I press the run button it only runs the first form I created. For test purposes I want to run the the second form I created. How should I do that? I use Visual Studio 2015. I just want to run only one form, or first I want to run the second form I created.

Answer

In the Solution Explorer, go to Program.cs and in the Main() function change

Application.Run(new Form1());

to

Application.Run(new Form2());

or whatever your other forms are called.