Home All Groups Group Topic Archive Search About

Splash screens / loading & unloading forms

Author
20 Feb 2006 6:35 AM
Eric A. Johnson
In a new project I'm creating, I have my first form that loads being used as
a splash screen, with a timer that activates after 5 seconds.  I then want
the main form to load.  However, it isn't allowing me to use frmMain.Load().
What can I use to load the main form, then unload the splash screen?  Or
should I, perhaps, load an invisible control form that first loads the
splash screen, waits five seconds, then unloads it and loads the main form?
This might be a nice idea, since I may want to have other forms load and
unload... how can I get forms to be loaded and unloaded at will from an
invisible master form, say, frmControl?  Thanks in advance for any
suggestions!

-- Eric

Author
20 Feb 2006 7:08 AM
Peter W Johnson
Eric,

This is what I do:-

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



Me.Hide()

Dim splash As frmSplash

splash = New frmSplash

splash.Show()

splash.Update()

Thread.Sleep(2500)

splash.Close()

Me.Visible = True



End Sub

Cheers


Peter



Show quoteHide quote
"Eric A. Johnson" <noth***@dontlookforme.com> wrote in message
news:5rdKf.22411$_S7.1113@newssvr14.news.prodigy.com...
> In a new project I'm creating, I have my first form that loads being used
> as a splash screen, with a timer that activates after 5 seconds.  I then
> want the main form to load.  However, it isn't allowing me to use
> frmMain.Load(). What can I use to load the main form, then unload the
> splash screen?  Or should I, perhaps, load an invisible control form that
> first loads the splash screen, waits five seconds, then unloads it and
> loads the main form? This might be a nice idea, since I may want to have
> other forms load and unload... how can I get forms to be loaded and
> unloaded at will from an invisible master form, say, frmControl?  Thanks
> in advance for any suggestions!
>
> -- Eric
>
>
Author
20 Feb 2006 7:32 AM
Cor Ligthert [MVP]
Eric,

There are probably thousand of ways to make a splash screen.

However the last thing you have to do is know to use the right instructions.
"Form.Load" is an event that fires as soon as a form start loading and will
not start showing a form.  You get the instructions for that when you click
on your form.

Therefore I think it is better for you to just create your program and know
how that goes and than afterwards add a splash screen, something that is if
your program is OOP seldom a problem.

Just my thought,

Cor
Author
21 Feb 2006 7:36 AM
Cor Ligthert [MVP]
Added sample to follow up message

Cor