Set time to display splash screen-VBForums
Results 1 to 10 of 10

Thread: Set time to display splash screen

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2006
    Posts
    2

    Set time to display splash screen

    I am making an application that has a splash screen and I have no clue about how to set the time it displays. I am using VS and go to the project properties and go to View Application Events and it brings up Namespace My and some comments about which events are available but it does not say a thing about Display Time. What code is supposed to go there? Or is there some property setting that I am missing?


    Thanks for the help.

  2. #2
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,920

    Re: Set time to display splash screen

    what do you mean by "set the time it displays"? do you have a control on the splash screen and want to show the date in that control? Explain a little bit more of your problem.

  3. #3
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    88,948

    Re: Set time to display splash screen

    Read the MSDN help topic for the My.Application.MinimumSplashScreenDisplayTime property, which explains what to do and provides a code example. Note that you set the minimum time the splash screen is displayed, not the absolute time. If your main form is not ready to be displayed when that minimum time elapses then the splash screen will remain visible until it is.

    Note that the code requires that you override the OnInitialize method. Let the IDE help by simply typing "overrides " and then selecting the OnInitialize method from the Intellisense listing. The IDE will then generate the method skeleton and you just have to add one line of code.

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2006
    Posts
    2

    Re: Set time to display splash screen

    I want to set it so it will display itself for a few seconds and then go to the next form in the app, as it now does not go away. I need to know what code to put where in the project. The info in this link does not say where to put the code My.Application.MinimumSplashScreenDisplayTime property,
    Thank you for your help!
    Last edited by kevdmiller; Dec 1st, 2006 at 08:51 PM.

  5. #5
    PowerPoster VBDT's Avatar
    Join Date
    Sep 2005
    Location
    CA - USA
    Posts
    2,920

    Re: Set time to display splash screen

    Did you add the SplashScreen in the design time or in the code?

  6. #6
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    88,948

    Re: Set time to display splash screen

    Quote Originally Posted by kevdmiller
    The info in this link does not say where to put the code My.Application.MinimumSplashScreenDisplayTime property,
    Thank you for your help!
    Of course it does. Here's a quote from that page:
    You should set the My.Application.MinimumSplashScreenDisplayTime property in a method that overrides the OnInitialize or OnCreateSplashScreen method. Code that overrides methods of the WindowsFormsApplicationBase class should be entered in the ApplicationEvents.vb file, which is hidden by default.
    To access the Code Editor window for overriding members

    1. With a project selected in Solution Explorer, click Properties on the Project menu.
    2. Click the Application tab.
    3. Click the View Application Events button to open the Code Editor.
    I don't think it could be much clearer.

    To display a splash screen in a VB 2005 app you simply add the desired form to your project and then select it from the drop-down list on the Application tab of the project properties. You still keep the same main form as before. The VB application model does all the work of displaying the splash screen form in a worker thread, dismissing it and displaying your main form at the appropriate time. This topic is at the top of the results of an MSDN search for splash screen visual basic. Links to the My.Application.MinimumSplashScreenDisplayTime property are also included in the results of that search.

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL

  7. #7
    Lively Member
    Join Date
    Aug 2006
    Posts
    72

    Re: Set time to display splash screen

    I never use the premade splash screen.I don't like it

    Maybe you are also better of with a custom splash screen

  8. #8
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    88,948

    Re: Set time to display splash screen

    Quote Originally Posted by Patrickssj6
    I never use the premade splash screen.I don't like it

    Maybe you are also better of with a custom splash screen
    That's got nothing to do with it. The Splash Screen item template is simply a form. You can use the template and customise it or you can start with a standard form. Either way you can select any form you like as the application's splash screen and the application framework takes care of the rest.

    2007-2014

    Why is my data not saved to my database? | MSDN Data Walkthroughs
    MSDN "How Do I?" Videos: VB | C#
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts) | WP8 Turnstile Feather Transition with Pivot Control
    Beginner Tutorials: VB | C# | SQL

  9. #9
    Junior Member
    Join Date
    Nov 2006
    Posts
    26

    Re: Set time to display splash screen

    I actualy went into this, you can just porvide the exact same thing but this is more of a fake-splash screen. you create a form with a timer
    on that timer you could put the interval to 7000 and then in the code put
    VB Code:
    1. Form1.Show()
    2.         Me.Close()
    3.         Timer2.Enabled = False
    and it works. you just have to put the content on it, and it works like a charm, but it has to be the startinf form. also set application close or whatever to last form.

  10. #10
    Registered User
    Join Date
    Dec 2012
    Posts
    4

    Re: Set time to display splash screen

    Quote Originally Posted by jmcilhinney View Post
    Read the MSDN help topic for the My.Application.MinimumSplashScreenDisplayTime property, which explains what to do and provides a code example. Note that you set the minimum time the splash screen is displayed, not the absolute time. If your main form is not ready to be displayed when that minimum time elapses then the splash screen will remain visible until it is.
    .
    I achieved to make that but now I have another issue that MDI form come up in still displaying time of SplashScreen. MDI form appears in one second but I set SplashScreen for 5 seconds but MDI form does not obey that OnInitialize function's time value. Can you help me about that?

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.