-
Nov 30th, 2006, 11:28 PM
#1
Thread Starter
New Member
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.
-
Nov 30th, 2006, 11:36 PM
#2
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.
-
Nov 30th, 2006, 11:57 PM
#3
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.
Last edited by jmcilhinney; May 9th, 2022 at 10:01 PM.
-
Dec 1st, 2006, 08:48 PM
#4
Thread Starter
New Member
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.
-
Dec 1st, 2006, 09:06 PM
#5
Re: Set time to display splash screen
Did you add the SplashScreen in the design time or in the code?
-
Dec 1st, 2006, 09:55 PM
#6
Re: Set time to display splash screen
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.
-
Dec 1st, 2006, 10:44 PM
#7
Lively Member
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
-
Dec 1st, 2006, 11:20 PM
#8
Re: Set time to display splash screen
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.
-
Dec 3rd, 2006, 08:04 PM
#9
Junior Member
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:
Form1.Show()
Me.Close()
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.
-
May 30th, 2013, 10:28 PM
#10
Registered User
Re: Set time to display splash screen
Originally Posted by jmcilhinney
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|