I have two forms in a visual C# forms application. I want to load one form before the other, however it automatically loads form1 first (even though that's the one I want to have load second).
How do I change that?
Look at Program.cs
, which will probably have something like:
Application.Run(new Form1());
Change that to start with the second form.
you need to modify Program.cs
here is sample
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
it is loading Form1.cs by default you can set to load any form
If i want to launch MyForm.cs
then i would change it like
Application.Run(new MyForm());
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With