Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Splash screen

 
 
Old 11-01-2006   #1 (permalink)
MV


 
 

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 SpecsSystem Spec
Old 11-02-2006   #2 (permalink)
MV


 
 

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 SpecsSystem Spec
Old 11-02-2006   #3 (permalink)
Bob


 
 

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 SpecsSystem Spec
 

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


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46