|
-
Mar 14th, 2016, 02:57 PM
#1
[RESOLVED] Halt Splash Screen
I rarely have a need to use a splash screen until now. I also cannot name the control for NDA reasons.
What I'm doing is connecting to something asynchronously in the splash screen and I cannot continue unto the application's startup form until it is connected. During this time there may be some exceptions thrown and I handle those, but I know that everything is connected whenever I reach the ConnectedCompleted event of the thing that I'm connecting to.
My question is there something that I can do that will keep the splash screen up until the ConnectedCompleted event has fired then once it has fired I can let the splash screen? If not, what I'm thinking of doing is just using the splash screen as the startup form and just calling Show on the actual startup form and not setting a splash screen for the application.
-
Mar 14th, 2016, 03:01 PM
#2
Re: Halt Splash Screen
Here's how I'd probably do it:
1) don't set a Splash Screen in the properties.
2) Handle the ApplicationStartup event
3) In said event, create an instance of the form to use as the Splash, show it, then continue on with what you need to do to connect.
4) Once connected, hide the splash screen, then allow the event handler to end and the startup object will show.
-tg
-
Mar 14th, 2016, 03:05 PM
#3
Re: Halt Splash Screen
Wow, I do like that process much better than my alternative.
My question is... The behavior that I'm trying to do is exactly how I think of a splash screen. Why does MS not provide a method to continue on with the application within the splash screen?
-
Mar 14th, 2016, 08:03 PM
#4
Re: [RESOLVED] Halt Splash Screen
because every excuse for a splash screen is different... I guess... I don't know.
I suppose it's because more often than not, people have a splash screen because they think they need one, not because they really do. With the way MS did it with the application architecture the splash screen is actually launched on a secondary thread... so it's not even usable... nor can you use it to communicate back... that was one of the hardest lessons I learned early on when I was trying to load data in the background.
And then the call isn't even async... bleh. so, yeah, I'm not sure I get it either.
-tg
-
Mar 14th, 2016, 08:48 PM
#5
Re: Halt Splash Screen
 Originally Posted by dday9
Why does MS not provide a method to continue on with the application within the splash screen?
That doesn't make any sense. Continue on with the application IN the splash screen? A splash screen is something that appears before the application proper. Anything else is not a splash screen.
The way the inbuilt splash screen functionality works is that the splash screen remains visible until the Load event handler of the startup form is complete. Once the startup form has loaded, the application is ready to go. All you have to do in your case is to not let the Load event handler complete until everything that is required has been done. The logical thing to do seems to me to be to make that connection on a secondary thread and wait on that thread in the Load event handler. Then you don't need to do anything extra with the splash screen.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|