splash screen

juster21

Member
Joined
Oct 1, 2008
Messages
9
Programming Experience
1-3
My splash screen only shows itself for a second before meing replaced by the main form (which hasn't completely loaded).
I'd like to have the splash show for at least 3 seconds.
Below is the code that I have...
VB.NET:
  My.Application.MinimumSplashScreenDisplayTime = 15000

..but remember that the main form shows before completely being loaded.

Help!!
 
15000 = 15 seconds btw.

I've never had a need to use a splash screen and I don't know how .Net's splash screen work, but what I would do is use threading from Sub Main to show the splash screen on a 2nd thread while the UI thread (main thread) loads the main form, then when the main form's loaded have the splash screen go away (be destroyed in memory) since it's no longer needed.
 
Thanks...I extended the time the splash screen shows to 15 seconds but it still disappears after about a second. Actually, the main form is showing before the splash screen even disappears. Any idea what would cause that?
 
Where do I put the OnInitialize code? The code I have for the time of the splash screen is currently in the splash load event.
 
As described in help article I linked; follow the steps 1-3 under "To access the Code Editor window for overriding members", add the code given in "Example".
 
If I read it right it says to put the OverRide code in ApplicationEvents.vb
Here's the code:

Public Class ApplicationEvents
Protected Function OnInitialize(ByVal commandLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of String)) As Boolean
' Set the display time to 5000 milliseconds (5 seconds).
My.Application.MinimumSplashScreenDisplayTime = 5000
Return MyBase.OnInitialize(commandLineArgs)
End Function
End Class

But I get an error message on the return (OnInitialize is not a member of Object)
 
ApplicationEvents.vb is a special file that you access by clicking the "Application Events" button as described in steps 1-3 in the help article.
 
yeah...I got that far but it doesn't seem to matter how high I set the minimum time, the main form is displayed after a second anyway
 
Then my bet is you are doing something wrong, because what is described in the article works just fine for me.
 
Back
Top