How to show form after Splash Screen closes

  • Thread starter Danny J. Lesandrini
  • Start date
D

Danny J. Lesandrini

Ok, this should be really, really easy ... but I can't figure it out.

My project is set to load frmSplash first, which runs some housekeeping stuff.
When that finishes, I want to open frmMain. This code DOESN'T WORK ...

Me.Close()
gfrmMain = New frmMain
gfrmMain.Show


the object variable, gfrmMain is declared in a public module.
Public gfrmMain As frmMain


The form loads ... flashes and dissappears when frmSplash is closed. If I set
frmSplash Not Visible, then the form remains, so clearly it's a scope issue. I
thought that if the variable is declared as a public frmMain, in a public module,
it would remain after frmSplash is closed ... but it doesn't

How can I accomplish this:
Open frmSplash
Run housekeeping code
Close frmSplash
Open frmMain

Thanks in advance for any suggestions you may have
 
C

Cor Ligthert

Hi Danny,

If you start your splash form from your main form it becomes suddenly much
more easy.

In the load event of your main form

dim frmSplash as FormSplash
frmSplash.show

When you than use a timer to close that frmplash.close or when the timer is
in the splash form me.close, than your proces can go on while your splash
form is showed. Do you want a dialog form than is better

dim frmDial as FormDial
frm.Dial.showdialog
myvariables = frmDial.aPublicProperty or variable
frm.Dialdispose

I hope this helps?

Cor
 

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