SPlash screen and loading another form

M

Maileen

Hi,

I have a module in which are define 2 forms as below :
'------
Module Module1
Public MyMain As New FMain
Public MySplash As New FSplash

Public Sub Main()
MySplash.Show()
End Sub
End Module
'-----

FSplash is a form based on a FormBorderStyle = none
In my MySplash, I have a timer which after 4 second should display the
Main form (a normal MDI or SDI form) behind the Splash screen.
When my Main form is fully loaded, Splash screen should disappear...

for this i use in my timer Tick :
Timer1.Stop()
MySplash.Hide()
MyMain.Show()
MySplash.Close()

but nothing works...

Please, could you help me ?
Because after this step, i would like to update my splash screen with
progress of loading my Main Form.

thanks a lot,
maileen
 
D

dave mann

I would imagine it is because when the splashscreen closes it passes
control back to the main sub which then continues. As there is nothing
else to do it ends and closes the application.
Have you tried showing the forms as a dialog :
Public Sub main()

form1.ShowDialog()
form2.ShowDialog()

End Sub

with the logic in the form1 :
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick

Me.Close()
End Sub

this will pass control to the splashscreen (form1)
which will retain control until the timer tick event closes the form1
and passes control back to sub main which opens form2 as a dialog
 
G

Guest

Hi

From the code of Timer1 Tick remove the line:
MySplash.Close()

This will close entire application, since this the beginning form. Just hide
the splash screen. Thats all. It will be closed later once the application is
closed.

Regards
Sooraj
Microsoft Community Star
 

Ask a Question

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.

Ask a Question

Top