I'm trying to start an application from command line arguments,
at Normal run, program runs and displays Form1.
I'm looking to start the application with command line arguments to start Form2.
Example: "myapp.exe -form2"
-form2 command line argument should start form2 instead form1.
my program.cs
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());
}
Question: Is it possible to show Form2 from command Line argument, like Application.Run(new Form2()); starts Form2.
Thanks in Advance.