473,320 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 1114
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Wayne Wengert | last post by:
In VB6 I used to use frmForm1.Show to make a form visible to the user and then use Unload frmForm1 to unload it. I have an app in which I need to "load" and "unload" forms based on user actions....
5
by: vineeth | last post by:
Hi I have GUI assembly which is loaded into a seprate Appdomain using AppDomain::Load method, after using it's function i unloaded the assembly by calling the AppDomain.UnLoad() method. But i can...
6
by: Pete Davis | last post by:
I'm confused about what precisely the limitations are on loading plugins in separate app domains. In all my previous apps that supported plugins, I've loaded them into the same domain as the app,...
2
by: Rob | last post by:
I was working on a project and everything was going fine, then all of a sudden the form set as my startup object stopped loading. I tried setting some others as the startup object, and some of my...
3
by: Eric A. Johnson | last post by:
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...
1
by: Geoff | last post by:
VB6. When selecting from drop down menu options I display different forms by using the Load (filename) and leave the form with Unload(Filename) The Load event allows me to program the ...
5
by: marfi95 | last post by:
I have a form that has a left and right panel. In the left panel is a treeview. The right panel I want to change dynamically based on the type of node selected. What I'm doing is loading the...
6
by: ernesto.tejeda | last post by:
Hello, I have a couple of questions regarding the loading of .js files for the browser and would like anyone to point me wher to find the answer (or if you know the answer and tell me will do just...
3
by: -Lost | last post by:
Runtime dependency loading, worth the trouble? I've been researching methods of "dynamically" loading and unloading dependencies at runtime (trying my best to think of a nice solution of loading...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.