Splash Scree Issue

bones

Well-known member
Joined
Aug 23, 2014
Messages
143
Programming Experience
Beginner
I created a Splash Screen for my application. Initially after creating it, things seemed to function as they did before it was created....with regard to debugging. That is to say when the startup screen was closed, the debugger stopped.

Now for some reason the splash screen is remaining open in the background...

I'm not getting any debug errors or anything... Any idea what's causing this? This is VB2010 Express.
 
You should use the inbuilt VB splash screen functionality but it sounds like you're not. Adding a splash screen does not mean that you change your startup form. The startup form should remain exactly the same as it was. In the project properties, you select your splash screen form as the splash screen for the application, not the startup form. The splash screen is then created first on a secondary thread and displayed. The startup form is then created and initialised, which can happen because the splash screen was created on a secondary thread. Once the startup form is ready and the prescribed period of time has elapsed, the splash screen is dismissed and the startup form displayed.
 
You should use the inbuilt VB splash screen functionality but it sounds like you're not. Adding a splash screen does not mean that you change your startup form. The startup form should remain exactly the same as it was. In the project properties, you select your splash screen form as the splash screen for the application, not the startup form. The splash screen is then created first on a secondary thread and displayed. The startup form is then created and initialised, which can happen because the splash screen was created on a secondary thread. Once the startup form is ready and the prescribed period of time has elapsed, the splash screen is dismissed and the startup form displayed.

Yes...all that is understood regarding startup form and splash screen. I customized one and have also created another and left it bone stock..no modifications to it. Both behave the same way. Both remain open in the background when the app is running in debug...

In researching I found others with the issue using VB10 Express. I followed a thread elsewhere that contained "Microsoft Fixes" that yielded mixed results for other people. I implemented the fix but it did not cure my issues..

Regarding Debug... Initially after first creating the splash screen and configuring the settings in project properties, application tab. The splash screen would open and then close upon the launching of the default form. To end debug all I had to do was close the default form.. Worked for a few days like that....no issue. I've since added and tested code on the default form as I progress the application along. I don't know what has caused the splash screen to misbehave [remain open in the background] rather than closing when the default form launches...but that's what it's doing now....
 
You should use the inbuilt VB splash screen functionality but it sounds like you're not. Adding a splash screen does not mean that you change your startup form. The startup form should remain exactly the same as it was. In the project properties, you select your splash screen form as the splash screen for the application, not the startup form. The splash screen is then created first on a secondary thread and displayed. The startup form is then created and initialised, which can happen because the splash screen was created on a secondary thread. Once the startup form is ready and the prescribed period of time has elapsed, the splash screen is dismissed and the startup form displayed.

:grief: I get that.... there is no misconception on how that works....

THE PROBLEM is the splash screen remains open after the startup form loads...

In researching the problem I discovered there was no code generated by the system when the form was created [project properties - view application events]

I found this code and added it to applicationevents.vb. It is my understanding that it should close the splash after 5 seconds. It doesn't do that. Do you see anything wrong with the code? Am I lacking other code that should also be in applicationevents.vb?


VB.NET:
Namespace My


    ' The following events are available for MyApplication:
    ' 
    ' Startup: Raised when the application starts, before the startup form is created.
    ' Shutdown: Raised after all application forms are closed.  This event is not raised if the application terminates abnormally.
    ' UnhandledException: Raised if the application encounters an unhandled exception.
    ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. 
    ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected.
    Partial Friend Class MyApplication


        Protected Overrides Function OnInitialize(ByVal commandLineArgs As System.Collections.ObjectModel.ReadOnlyCollection(Of String)) As Boolean
            Me.MinimumSplashScreenDisplayTime = 5000
            Return MyBase.OnInitialize(commandLineArgs)
        End Function




    End Class


End Namespace
 
In researching the problem I discovered there was no code generated by the system when the form was created [project properties - view application events]
Neither should there be unless you want to add code to handle application events or modify default application framework behaviour. The empty partial class is generated first time you click that button.
documentation said:
When you add a splash screen to your application using the Project Designer, it sets the My.Application.MinimumSplashScreenDisplayTime property to 2000, giving a minimum display time of two seconds.
As said it is minimum time, splash screen will remain at least that long, but will not be closed until main/startup form is finished initializing and has raised its Load event.
 
Neither should there be unless you want to add code to handle application events or modify default application framework behaviour. The empty partial class is generated first time you click that button.

As said it is minimum time, splash screen will remain at least that long, but will not be closed until main/startup form is finished initializing and has raised its Load event.

Based on that last statement then.... I would draw the conclusion that the startup form isn't finishing initializing..... Is that possible? It opens and the functions seem fine.... No errors are generated....
 
Back
Top