Sunday, July 26, 2009

How can i hide the main form until the splash screen is loaded?

using Visual C# Express

How can i hide the main form until the splash screen is loaded?
The main form won't display until the load event completes. What I do is instantiate my splash screen WinForm in the constructor or load event of the main form. As I load everything I update the progress on the splash screen and at the end close the splash screen.





I normally don't make the startup form the splash screen, because Application.Run which starts the message loop on the current thread and should be on the main dialog.
Reply:I would usually make the splash screen the first form to be loaded, then after a timer event finished it would load the main program's form and kill the splash screen.





Also you should be able to just set the main form's visibility to hidden.


No comments:

Post a Comment