I\'m a beginner c# programmer, and i\'m getting familiar with the Windows Forms App. I have 2 forms and i\'m trying to understand how to set one of them to be the first one
In your visual studi, when ever you open a project by default program.cs will open.
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
you can see above Application.Run(new Form1());
whatever your form name is type there, then whenever you are starting first this form will run
In Program.cs, you will see the following line of code
Application.Run(new Form1()); This line shows Form1. You can change it to do whatever you want.
Write in Program.cs
Application.Run(new YourMainForm());
In Program.cs
, you will see the following line of code
Application.Run(new Form1());
This line shows Form1
.
You can change it to do whatever you want.