I found an answer that shows a nice technique to use in order to accomplish this, but the answer was from 2008 and it doesn't appear to be valid today?
It recommended to remove the parameter from Application.Run()
in order to manually show/hide form as required. But in .NET Compact Edition 3.5
, parameter must be provided.
I have the following code with no luck, form still displays. I wish to hide the main form upon the program starting.
static class Program
{
public static Form1 MainForm = new Form1();
[MTAThread]
static void Main()
{
Application.Run(MainForm);
MainForm.Visible = false;
MainForm.Hide(); //Also tried this...
}
}
You don't have to use
Application.Run()
(with or w/o parameter):