-
Welcome window
First of all, I want to excuse for my bad english
I'm having c++ project @ university and I need some help. I'm working with Visual Studio 2008 Windows Forms. I made a web browser and now I need to make some kind of welcome screen leading to that browser or something like that. I should be something like a dialog window where is a text like "Welcome to my browser" and user pushes "OK" and then that browser loads. Of course if it's easier to make, it can be just simple welcome windows with "ok" button, and both windows (internet browser and dialog window) opens at same time but welcome windows should be in front.
Anyone can help with code ?
-
Re: Welcome window
What you want apparently is a splash screen.
To get one, simply define a form with any graphical elements on it you want, and no buttons. The form should contain a Timer object that you can add using the Forms Designer. You can also set up the timer's Interval (5000 ms, e.g.) and Enabled properties at design time. The form also needs a Tick event handler for the timer that simply should close the splash screen form.
Note: As I interpret the MSDN documentation on the Forms::Timer class, the timer should also be stopped in the Tick event handler before closing the form or it wouldn't be subject to garbage collection. In case this is a misinterpretation and explicitly stopping the timer is not necessary, someone who knows better might correct me.
Then, the main form's Load event handler should show the splash screen (modeless, using the splash screen form's Show() method). Further action is not required: The splash screen will close on its own when the timer expires.
HTH
-
Re: Welcome window
Thanks, worked out fine :)
-
Re: Welcome window
An additional note I figured out in the meantime: If you set up the timer object as I described in post #2, the timer will start running as soon as the splash screen form object is constructed, which is before the splash screen actually is shown. If you want the time the splash screen stays open to be closer to the actual timer interval you've set up, you better leave the timer's Enabled property false at design time and instead start the timer in the splash screen form's Load event handler.
It might not even make a notable difference to the user - I just wanted to mention it.