Library tutorials & articles
Splash Screens
- Introduction
- Creating it
- Showing it
Showing it
To show the splash form when the application is loading, whatever method you used to create the form, you need to set a few properties and add a few lines of code.
First, select Project | Properties... Select the General Tab, and change the Startup Object drop down to Sub Main.
Now, select Project | Add Module . Select Module from the list of items. Note, if you already have a module in your project, then you do not need to add a new one.
Then insert the following code into that new module:
Sub Main()
' Show the splash form
frmSplash.Show
' Load the main form
Load frmMain
' Load any other forms you may have that you need
' Show the main form
frmMain.Show
' Remove the splash form from the memory
Unload frmSplash
End Sub
If the splash screen does not appear for long enough, that is because your program is too small! To get round this, you can add a timer to the splash screen so that it will appear for x number of seconds. Add the control, name it tmrShow, set its Interval property to 2000 (2 second) and add the following code to the splash form:
Private Sub tmrShow_Timer()
tmrShow.Enabled = False
ResumeStartup 'resume the startup
Unload Me 'unload the form (hide it)
End Sub
Then, modify the module startup code:
Sub Main()
' Show the splash form
frmSplash.Show 'as the form loads, the timer will start
End Sub
Sub ResumeStartUp()
' Load the main form
Load frmMain
' Load any other forms you may have that you need
' Show the main form
frmMain.Show
End Sub
Related articles
Related discussion
-
Run-time error '91'
by converter2009 (1 replies)
-
VB6 Runtime error 381 subsript out of range Error
by Uncle (2 replies)
-
passing and reading parameters from using Shell
by jigartoliya (0 replies)
-
Convert C++ code to VB6
by mawcot (4 replies)
-
listbox scrollbar
by Dennijr (10 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
i am running vb.net 2003. I cannot get the code for a splash screen to work. It is possible for u to send me code so it will work. Thanks
Hi,
I am working on a VB.NET application and wanted to implement a Splash screen, I have created a form from Scratch and pasted my .jpeg file on that form. In my main function, I have created an instance of that form
dim splash as frmSplash
splash = new frmSplash()
splash.show()
at this point, I can see a window only on the Windows task bar but not displayed on Screen. after this a statement is executed for main form i.e.
frmMain.showDialog()
after this statement, screen appears above main form.
When i use
splash.showDialog() in place of splash.show(),
the screen appears as required but application will not proceed furthur. It is not moving to next statement at all.
how can i correct this problem?
Add a timer to the splash form and click on it to edit the properties
where do you put the interval
It is a good one, simple and to the point
Thanks
Mark
This thread is for discussions of Splash Screens.