I have a windows form i want to start on different tab pages from the command line.
This is because the form can be launched by the time/cron service at date/times the
user specifies.
How can i get the form application context to go to the non default first tab ?
[STAThread]
static void Main (string[] args)
{
Debug.WriteLine("Environment Args= {0}", args.Count());
for (int i=0; i < args.Count(); i++)
{
Debug.WriteLine(String.Format("{0}:{1}", i, args[i]));
}
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Form myForm = new DailyDirectories();
if (args.Count() > 0)
{
Application.Run(myForm.??? );
}
}
You may try to pass a parameter to your form class or even set a property.
Within your form class you’ll have to add/change the source.