Displaying a Splash Screen on Startup
If you need to execute a lengthy procedure on startup, such as loading a large amount of data from a database or loading several large bitmaps, you might want to display a splash screen on startup. A splash screen is a form, usually displaying information such as the name of the application, copyright information, and a simple bitmap. The screen that is displayed when you start Visual Basic is a splash screen.
To display a splash screen, use a Sub Main procedure as your startup object and use the Show method to display the form:
Private Sub Main()
' Show the splash screen.
frmSplash.Show
' Add your startup procedures here.
…
' Show the main form and unload the splash screen.
frmMain.Show
Unload frmSplash
End Sub
The splash screen occupies the user's attention while your startup procedures are executing, giving the illusion that the application is loading faster. When the startup procedures are completed, you can load your first form and unload the splash screen.
In designing a splash screen, it's a good idea to keep it simple. If you use large bitmaps or a lot of controls, the splash screen itself may be slow to load.