![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #2 (permalink) |
| Guest | 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 > > |
| | #3 (permalink) |
| Guest | 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 > > |
| | #4 (permalink) |
| Guest | 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. |
| | #5 (permalink) |
| Guest | 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. |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Splash screen | bobster | Live Mail | 6 | 06-19-2008 11:43 PM |
| Vista Splash Screen | Woody | Vista General | 2 | 10-26-2007 11:33 PM |
| Splash Screen | Nick | Vista mail | 1 | 04-21-2007 08:23 PM |
| Splash screen | DaddyBob | Vista General | 3 | 06-29-2006 04:26 PM |
| Splash screen | DaddyBob | Vista General | 1 | 06-29-2006 04:05 PM |