Splash screen

J

John

Hi

I have a main sub as start-up. I need to display a splash screen and while
it is displayed I need to do some stuff in the background like opening db
connections etc. After that is done I need to close splash and open a login
form. Can anyone give me a code example of how to do this elegantly?

Thanks

Regards
 
V

Vagabond Software

John said:
Hi

I have a main sub as start-up. I need to display a splash screen and while
it is displayed I need to do some stuff in the background like opening db
connections etc. After that is done I need to close splash and open a
login form. Can anyone give me a code example of how to do this elegantly?

Thanks

I don't know how "elegant" this is, but it's one way to do it. In your
sub-main module:

Public Shared Sub Main()

'Load Splash
splashForm = New Splash
splashForm.Show()

'Setup Data Access Layer
'blah blah blah

'Setup Business Layer
'blah blah blah

'Load GUI
mainForm = New FormMain
Application.Run(mainForm)

End Sub

In the FormMain Load event:

Private Sub FormMain_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

'Do some stuff
splashForm.Update()

'Ready to present GUI to end-user
splashForm.Close()

End Sub

I hope this helps, good luck.

Carl
 
M

Mark Broadbent

this would potentially cause a rendering problem if user does anything
during load time (such as drag another app window across loading app).
Threading is ideally needed.
br,
Mark.
 

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