I'm trying to display a stratup screen, and then after 5 seconds, unload the
startup screen from memory, then show the main form.
It just flashes the main form for a fraction of a second, then when the
splash screen closes (me.close) the program closes. It should load the main
screen.
In your mainform
\\\
dim frm as new formSplash
frm.showsplash
'formSplasy has by instance a form timer
'and when those event fires (tick) in that me.close
frm.dispose
///
Daniel, you should do it like this (probably the best way for splashing a
form):
1- Use a separate module for starting your application like this :
Public Module Entery
Public Sub Main()
Dim frm1 As New SplashForm
frm1.Show()
Threading.Thread.Sleep(5000)
frm1.Close()
Application.Run(New Form1)
End Sub
End Module
2- And "SplashForm" is the form you want to splash before the main form (
Form1).
3- Don't forget to set the project start up object to "Sub Main".
For better results, use the following module ( Application.DoEvents Is
added):
Public Module Entery
Public Sub Main()
Dim frm1 As New SplashForm
frm1.Show()
Application.DoEvents()
Threading.Thread.Sleep(5000)
frm1.Close()
Application.Run(New Form1)
End Sub
End Module
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.