Hiding a winform just as it runs...
-
Hello all, I have a winform which I want to hide just after the InitializeComponent method is called. I tried using Hide() to no avail. Any insights? Thanks. Alberto Bar-Noy Software Engineer http://www.certagon.com
-
Hello all, I have a winform which I want to hide just after the InitializeComponent method is called. I tried using Hide() to no avail. Any insights? Thanks. Alberto Bar-Noy Software Engineer http://www.certagon.com
Override the form's OnLoad procedure and change the Opacity to 0.0. You can't really Hide() or use Visible = false to do this. WHen you need to show the form again, change the Opacity back to 1.0. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
Hello all, I have a winform which I want to hide just after the InitializeComponent method is called. I tried using Hide() to no avail. Any insights? Thanks. Alberto Bar-Noy Software Engineer http://www.certagon.com
When Application.Run(myForm) is called, myForm is made visible. By this point the form has already been created and therefore its constructor and the InitializeComponent() method have already been called. Use Application.Run() instead of Application.Run(myForm). This will start the message loop without making any form visible. You will likely then want to add Application.ExitThread() to an event handler for the Closed event of your main form. -Chris