![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | Splash screen Does anyone have a good example in how to implement a splashscreen in a WPF application? I have been looking at the DispatcherTimer but I'm not shure in how to do an implementation, so all recommendations/ideas are welcome! Thanx in advance |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Splash screen Well I guess I need to fill in some more information to have some answers here:-) In the post at http://forums.microsoft.com/MSDN/Sho...72330&SiteID=1 (Post no. 4), Jason Brittsan from MSFT has this sample to show a splash screen until the app is ready: void WindowLoaded(object sender, RoutedEventArgs args) { DispatcherTimer dt = new DispatcherTimer(DispatcherPriority.Normal); dt.Interval = new TimeSpan(0, 0, 5); dt.Tick += new EventHandler(dt_Tick); dt.Start(); } void dt_Tick(object sender, EventArgs e) { this.Close(); } To me it look like the dt_Tick event will be triggered after 5 seconds, meaning that the window (this) will be closed! Have I missed something here or what? Regards "MV" wrote: > Does anyone have a good example in how to implement a splashscreen in a WPF > application? > > I have been looking at the DispatcherTimer but I'm not shure in how to do an > implementation, so all recommendations/ideas are welcome! > > Thanx in advance > > |
My System Specs![]() |
| | #3 (permalink) |
| | RE: Splash screen In article <55C5A255-FE32-4D48-8DCE-DD37DE62B087@microsoft.com>, MV@discussions.microsoft.com says... > Well I guess I need to fill in some more information to have some answers > here:-) > > In the post at > http://forums.microsoft.com/MSDN/Sho...72330&SiteID=1 (Post > no. 4), > Jason Brittsan from MSFT has this sample to show a splash screen until the > app is ready: > > void WindowLoaded(object sender, RoutedEventArgs args) > { > DispatcherTimer dt = new > DispatcherTimer(DispatcherPriority.Normal); > dt.Interval = new TimeSpan(0, 0, 5); > dt.Tick += new EventHandler(dt_Tick); > dt.Start(); > } > > void dt_Tick(object sender, EventArgs e) > { > this.Close(); > } > > To me it look like the dt_Tick event will be triggered after 5 seconds, > meaning that the window (this) will be closed! Have I missed something here > or what? > > Regards > > > > > "MV" wrote: > > > Does anyone have a good example in how to implement a splashscreen in a WPF > > application? > > > > I have been looking at the DispatcherTimer but I'm not shure in how to do an > > implementation, so all recommendations/ideas are welcome! > > > > Thanx in advance > > > > > the 'this' you are asking about will refer to the object that the event handler has been registered with... If you place the line: this.Loaded += new RoutedEventHandler(WindowLoaded); in the ctor of the main Window then yes, it will close the App, but if you created/showed a new Window in the main Widow's ctor - the spalsh window - and then in ITS ctor registered the Loaded event handler then that spalsh window will be closed when the timer fires. |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Splash Screen | Live Mail | |||
| Splash screen | Live Mail | |||
| Splash Screen | Vista mail | |||
| Splash screen | Vista General | |||
| Splash screen | Vista General | |||