469,934 Members | 1,984 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,934 developers. It's quick & easy.

Quesion about loading/unloading/hiding forms

Hello Everyone,

I'm writing an application that, so far, only has three forms:

frmSplashScreen
frmLicenseScreen
frmConfigurationScreen

Now, frmSplashScreen has a timer that sits it on screen for 2 seconds
then executes the following commands:

frmLicenseScreen.Show()
Me.Hide()

So, frmLicenseScreen is loaded properly and frmSplashScreen is HIDDEN
(not closed becasue that would kill the application).

Next, there is a button click that executes the following commands:

frmConfigurationScreen.Show()
Me.Close()

At this point, the ONLY form being shown on the screen is
frmConfigurationScreen. That's true for about 2 seconds. After that,
frmLicenseScreen pops up again and we start the process all over
again.

I'm confused. I know I can't Me.Close() frmSplashScreen since that
would kill the application. But what am I doing wrong that is making
frm.LicenseAgreement reopen?

Thanks in Advance,
Anthony
Aug 22 '08 #1
3 1002
You most likely have your main form on a timer that keeps re-running as the
interval hits.

You can assign a splash screen through the Project Properties portion, and
still have your 'Main Form' be your main form.
-In your Solutions explorer, right click on your Project Name, click
properties.
Then go to the 'Application tab' on the left.
Take a look at yoru startup form - and also scroll down to the bottom, and
notice there is a spot to put a splash screen as well ( if you do not want
to do this manually. )

The other manual way of doing this is making your "Main Form" be your main
form, and within the form load of it, open up the other form, show it for 2
seconds, and then close it.

If your frmConfigurationScreen is your 'MainForm', ... I would load that,
and load the others around it.

Miro

"Anthony P." <pa*******@gmail.comwrote in message
news:a0**********************************@x41g2000 hsb.googlegroups.com...
Hello Everyone,

I'm writing an application that, so far, only has three forms:

frmSplashScreen
frmLicenseScreen
frmConfigurationScreen

Now, frmSplashScreen has a timer that sits it on screen for 2 seconds
then executes the following commands:

frmLicenseScreen.Show()
Me.Hide()

So, frmLicenseScreen is loaded properly and frmSplashScreen is HIDDEN
(not closed becasue that would kill the application).

Next, there is a button click that executes the following commands:

frmConfigurationScreen.Show()
Me.Close()

At this point, the ONLY form being shown on the screen is
frmConfigurationScreen. That's true for about 2 seconds. After that,
frmLicenseScreen pops up again and we start the process all over
again.

I'm confused. I know I can't Me.Close() frmSplashScreen since that
would kill the application. But what am I doing wrong that is making
frm.LicenseAgreement reopen?

Thanks in Advance,
Anthony
Aug 22 '08 #2
You most likely have your main form on a timer that keeps re-running as the
interval hits.
You're right. Never even dawned on me that it was the timer creating
the problem. I guess I didn't think that, once a form was hidden, the
timer would keep firing. That solves that!
You can assign a splash screen through the Project Properties portion, and
still have your 'Main Form' be your main form.
-In your Solutions explorer, right click on your Project Name, click
properties.
Then go to the 'Application tab' on the left.
Take a look at yoru startup form - and also scroll down to the bottom, and
notice there is a spot to put a splash screen as well ( if you do not want
to do this manually. )
I knew that but, for some reason (which I can't remember now) chose
not to use it. Since I can't really remember why I didn't use it, I
think I might go back and try it to see what happens.

Thanks for your help!

Anthony
Aug 22 '08 #3
If you do not want to,
just do this ( if you still want it to work on a timer )

Start your main form,
start a timer - on an interval

within the timer code put
timer.enabled = false
( so no other forms will pop up )

and then you can close the form whenever you need to.

I wanted to show my splash screen longer for non registered users so I did
somethign like this:
(written in notepad ) but you should get the idea...
main form was loaded
within main form_load i did:
timer1.enabled = true
( i wanted the main form to load and wait 5 seconds before showing the
screen )

on the timer routine i did
timer1.enabled = false
splashscreen.showmodal()

then within splashform on form load I added a new timer ( we will call it
timer 2 )
timer2.enabled = true
within the timer event
form.close()

that way I was able to hit my timer1 anytime i saw fit to show a modal
screen overtop of my mdi form,
and within timer2 i was able to make it last for an X amount of time until I
saw fit befoer it dissapeared.

Was an easy solution to give someone a quick demo of a quick exe that worked
100% but still had a splash screen showing
here and there that was bothersome enough to be an annoyance.

quick and dirty - but it worked.

Miro
"Anthony P." <pa*******@gmail.comwrote in message
news:22**********************************@k13g2000 hse.googlegroups.com...
>You most likely have your main form on a timer that keeps re-running as
the
interval hits.

You're right. Never even dawned on me that it was the timer creating
the problem. I guess I didn't think that, once a form was hidden, the
timer would keep firing. That solves that!
>You can assign a splash screen through the Project Properties portion,
and
still have your 'Main Form' be your main form.
-In your Solutions explorer, right click on your Project Name, click
properties.
Then go to the 'Application tab' on the left.
Take a look at yoru startup form - and also scroll down to the bottom,
and
notice there is a spot to put a splash screen as well ( if you do not
want
to do this manually. )

I knew that but, for some reason (which I can't remember now) chose
not to use it. Since I can't really remember why I didn't use it, I
think I might go back and try it to see what happens.

Thanks for your help!

Anthony
Aug 22 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Wayne Wengert | last post: by
5 posts views Thread by vineeth | last post: by
6 posts views Thread by Pete Davis | last post: by
2 posts views Thread by Rob | last post: by
3 posts views Thread by Eric A. Johnson | last post: by
1 post views Thread by Geoff | last post: by
6 posts views Thread by ernesto.tejeda | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.