|
Hi I have an application has a main form, this form loads lot of data and make lot of work ... by time this form took lot of time to load the data from database ... the people suggested to add Splash Screen, but I can't move the loading code from the main form to the Splash Screen, and the main form is the one who will tell the Splash Screen that the loading of data is done. So, how to add the Splash Screen without changing my main form code ! | | Magdy_Roshdy Tuesday, September 15, 2009 7:02 AM | Hi,
@Geert van Horrik code first show the SplashScreen then show the MainForm. So you don’t need to hide the mainform. Mainform shows after the SplashScreen.
You can add a timer to the splashScreen. After several minutes, close the splashScreen. There is a perfect splashScreen sample in CodeFx: Windows Forms. Hope this helps.
http://cfx.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33087#DownloadId=83988
Best regards,
Ling Wang
Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. - Marked As Answer byLing WangMSFT, ModeratorWednesday, September 23, 2009 3:10 AM
-
| | Ling Wang Monday, September 21, 2009 10:11 AM | It shouldn't be the Main Form that loads the splash screen. You should load the splash screen in your Program.Main method like this:
// Show splash screen
SplashScreen splash = new SplashScreen();
splash.ShowDialog();
// Start main form
Application.Run(MainForm.Instance);
Then, you can determine if any initialization went wrong (and thus decide even not to show the main form). I always make my Main Form a singleton class, so I can create an instance of it, and then load it in the splash screen (but not yet show it).
Geert van Horrik - CatenaLogic
Visit my blog: http://blog.catenalogic.com
Looking for a way to deploy your updates to all your clients? Try Updater! - Marked As Answer byLing WangMSFT, ModeratorWednesday, September 23, 2009 3:09 AM
-
| | Geert van Horrik Tuesday, September 15, 2009 7:31 AM | It shouldn't be the Main Form that loads the splash screen. You should load the splash screen in your Program.Main method like this:
// Show splash screen
SplashScreen splash = new SplashScreen();
splash.ShowDialog();
// Start main form
Application.Run(MainForm.Instance);
Then, you can determine if any initialization went wrong (and thus decide even not to show the main form). I always make my Main Form a singleton class, so I can create an instance of it, and then load it in the splash screen (but not yet show it).
Geert van Horrik - CatenaLogic
Visit my blog: http://blog.catenalogic.com
Looking for a way to deploy your updates to all your clients? Try Updater! - Marked As Answer byLing WangMSFT, ModeratorWednesday, September 23, 2009 3:09 AM
-
| | Geert van Horrik Tuesday, September 15, 2009 7:31 AM | Yes Geert ... thank you But which event I should use to hide the main form before appears, I don't want it to flicker. Something else ... how can I hide the splash screen after the main form is loaded since it is a member in the program? | | Magdy_Roshdy Tuesday, September 15, 2009 8:01 AM | Hi,
@Geert van Horrik code first show the SplashScreen then show the MainForm. So you don’t need to hide the mainform. Mainform shows after the SplashScreen.
You can add a timer to the splashScreen. After several minutes, close the splashScreen. There is a perfect splashScreen sample in CodeFx: Windows Forms. Hope this helps.
http://cfx.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=33087#DownloadId=83988
Best regards,
Ling Wang
Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. - Marked As Answer byLing WangMSFT, ModeratorWednesday, September 23, 2009 3:10 AM
-
| | Ling Wang Monday, September 21, 2009 10:11 AM |
|