Results 1 to 4 of 4

Thread: [RESOLVED] Splash Screen - Login Form - Main Form

  1. #1

    Thread Starter
    Lively Member Shardox's Avatar
    Join Date
    Nov 2006
    Location
    Barcelona, Spain
    Posts
    123

    Resolved [RESOLVED] Splash Screen - Login Form - Main Form

    Hello guys,

    My Main Form takes several seconds to load so I set a splash screen to be showed while this main form is loading. But now I want a Login Form to pop up before Main Form is showed. If I set my Login form as the startup form then the splash screen is showed only while login form is being loaded so I need to:
    - Show splash screen
    - Load Main Form but not display it
    - Show Login Form
    - If Login is correct then show main form previously loaded.

    I tried launching the login form from Main Form's Load event handler, but the splash screen keeps showing topmost over Login form. I am missing a "Loaded" event to handle.

    Thanks in advance for your help!
    Last edited by Shardox; Dec 11th, 2006 at 03:13 AM. Reason: [RESOLVED]

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

    Re: Splash Screen - Login Form - Main Form

    Your splash screen will not be dismissed until your startup form is loaded. Set the WindowState and ShowInTaskbar properties of your main form to Minimized and False respectively. That means that the form will not be seen when it is loaded. That also means that the splash screen will be dismissed. Now handle the Shown event of your main form and display your login form there. If the login is not successful then close the form and the app will exit gracefully. If the login is successful then set the WindowState and ShowInTaskbar properties back to Normal and True to display the form.
    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

  3. #3

    Thread Starter
    Lively Member Shardox's Avatar
    Join Date
    Nov 2006
    Location
    Barcelona, Spain
    Posts
    123

    Re: Splash Screen - Login Form - Main Form

    That's a clear and fast reply. Thanks a lot jmcilhinney, I will handle that shown event.

  4. #4
    New Member
    Join Date
    Jul 2007
    Posts
    2

    Re: [RESOLVED] Splash Screen - Login Form - Main Form

    vb Code:
    1. loginform.showdialog()

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