Hiding Form on Startup
-
Hey, How do you hide a form on startup so that it doesn't show at all. I want to hide a form initially until the user clicks on a notifyIcon. Currently...
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
this.Hide(); //or this.Visible = false;
}...does not work. Any suggestions? -- Adam "If you can't beat your computer in chess, try kickboxing"
-
Hey, How do you hide a form on startup so that it doesn't show at all. I want to hide a form initially until the user clicks on a notifyIcon. Currently...
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
this.Hide(); //or this.Visible = false;
}...does not work. Any suggestions? -- Adam "If you can't beat your computer in chess, try kickboxing"
Hey Adam, try this, to prevent the form to be created at startup, if the no-button is clicked. if (MessageBox.Show("Start Application", "Question", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == DialogResult.Yes) { Application.Run(new Form1()); } Maybe it's helpful... Jörg
-
Hey, How do you hide a form on startup so that it doesn't show at all. I want to hide a form initially until the user clicks on a notifyIcon. Currently...
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
this.Hide(); //or this.Visible = false;
}...does not work. Any suggestions? -- Adam "If you can't beat your computer in chess, try kickboxing"
-
Hey, How do you hide a form on startup so that it doesn't show at all. I want to hide a form initially until the user clicks on a notifyIcon. Currently...
public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
this.Hide(); //or this.Visible = false;
}...does not work. Any suggestions? -- Adam "If you can't beat your computer in chess, try kickboxing"
Okay, I've got a semi working solution, tell me if i'm doing anything that could lead to problems later.
public class Class1
{
static void Main()
{
Form1 form = new Form1();
Application.Run();
}
}
public class Form1 : System.Windows.Form
{
public Form1()
{
IntiallizeComponent();
this.Visible = false;
}
}This creates the notifyIcon in the system tray, but does not show the form. When the notifyIcon is double clicked, then the form pops up. When the form is disposed, i have it call Application.Exit() so that the Application quits properly...this is mostly what i'm concerned about, that the tread is terminating properly. -- Adam "If you can't beat your computer in chess, try kickboxing"