I have a main form that I was using. Now I created a Splash screen to jazz up my program. How to get my splash screen to load up first?
Printable View
I have a main form that I was using. Now I created a Splash screen to jazz up my program. How to get my splash screen to load up first?
Anyone??
Project->Properties->Startup Object
How do I set this up so my Main form displays after my splash screens timer expires?
Private Sub tmrAsiSplash_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrAsiSplash.Tick
Me.Close()
End Sub
Private Sub frmAsiSplash_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim Main As New frmMain
Main.Show()
End Sub
VB Code:
Private Sub tmrAsiSplash_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrAsiSplash.Tick Dim Main As New frmMain Main.Show() Me.Close() End Sub Private Sub frmAsiSplash_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub
It Just shuts the application down?
Create a new module and add a Sub Main in there. Change your startup object to Sub Main.
In sub main just have:
VB Code:
Sub Main() dim f as new frmAsiSplash f.ShowDialog() dim fMain as new frmMain fMain.showDialog() End sub
Then in frmAsiSplash, just have this:
VB Code:
Private Sub tmrAsiSplash_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrAsiSplash.Tick Dim Main As New frmMain Main.Show() Me.Close() End Sub
That worked but I was in some type of loop. my main form kept popping up ever few seconds.
Take the form main stuff out of the Tick event.