Results 1 to 5 of 5

Thread: [RESOLVED] Halt Splash Screen

  1. #1

    Thread Starter
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,397

    Resolved [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.
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Posts
    12,397

    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?
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | HtmlLessons | CssLessons | Code Tags | Sword of Fury - Jameram

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Halt Splash Screen

    Quote Originally Posted by dday9 View Post
    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width