What is the best way to hide the main form on application\'s startup to show it later?
If I just call the Hide
method in the Load
event of this
You can proceed like this:
private void Form1_Load(object sender, EventArgs e)
{
if (Settings.Instance.HideAtStartup)
{
BeginInvoke(new MethodInvoker(delegate
{
Hide();
}));
}
}
An alternative way can be to use the Application.Run(Form) method. You can create the main form with its Visible property initially set to false, and provide no argument to Application.Run() in main loop.