By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,742 Members | 1,044 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,742 IT Pros & Developers. It's quick & easy.

SPlash screen and loading another form

P: n/a
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
Nov 21 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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
"Maileen" wrote:
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

Nov 21 '05 #2

P: n/a

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
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 21 '05 #3

P: n/a
Maileen,

This sample that I made shows 2 splash screens,
One using a thread
One without that

http://groups.google.com/groups?selm...TNGP10.phx.gbl

I hope this helps?

Cor
Nov 21 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.