Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

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.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Splash screen

Closed Thread
 
Thread Tools Display Modes
Old 11-01-2006   #1 (permalink)
MV
Guest


 

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


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

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

Old 11-02-2006   #4 (permalink)
Bob
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.




Old 11-02-2006   #5 (permalink)
Bob
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.




Closed Thread

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








Vistax64.com 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 2005-2008

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 47 48 49 50