This to launch Form1, then Form2
public Form1()
{
this.Load+= Form1_Load;
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
Form2 myForm2 = new Form2();
myForm2.Show();
}
or to do without loading Form1 first, and forcing them into Form2 first.
public Form1()
{
Form2 myForm2 = new Form2();
myForm2.ShowDialog();
//ShowDialog() will prevent actions from happening on this
//thread until Form2 is closed.
InitializeComponent();
}
if you just want to start Form2 first, just modify the Program.cs
static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
if (args.Length == 0) //if no command line arguments, run Form1
{
Application.Run(new Form1());
}
else //if command line arguments exist, run Form2
{
Application.Run(new Form2());
}
}