473,320 Members | 1,881 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.

SplashForm

hi,

i have a startup form (like the ones you get in Microsoft Office) that
should open for a few seconds and then close. it works when you don't include
the line in the Stativ void main that will close it:
Application.EnableVisualStyles();
SplashForm sf = new SplashForm();
sf.Show();
//show the splash
Application.DoEvents();
//allow form to paint
sf.Close();
//<<this one
Application.Run(new Browser());

but if i don't include it, the form will be open until you terminate the
application. i want it to close.

tell me if my question isn't clear enough!

cheers,

--
Alvo von Cossel I of Germany
Nov 17 '05 #1
2 2590
Am I correct in thinking that your problem is that your SplashForm is closed
almost as soon as it is drawn? If that is the case... then that is by design
of your code, you are showing it, and almost immediately closing it. One way
you might improve your process would be to do some other initialization in
between sf.Show() and sf.Close(), maybe change that section to look something
like:

sf.Show();
//show the splash
Application.DoEvents();
//allow form to paint
Browser mainBrowser = new Browser();
//Do other initialization here
sf.Close();
Application.Run(mainBrowser);

The reason for the above method is that while your SplashScreen is
displayed, you are creating a new instance of your Browser and doing any
other initialization work that needs to be done prior to its being brought to
the forefront of the application and being in charge.

Brendan
"Alvo von Cossel I" wrote:
hi,

i have a startup form (like the ones you get in Microsoft Office) that
should open for a few seconds and then close. it works when you don't include
the line in the Stativ void main that will close it:
Application.EnableVisualStyles();
SplashForm sf = new SplashForm();
sf.Show();
//show the splash
Application.DoEvents();
//allow form to paint
sf.Close();
//<<this one
Application.Run(new Browser());

but if i don't include it, the form will be open until you terminate the
application. i want it to close.

tell me if my question isn't clear enough!

cheers,

--
Alvo von Cossel I of Germany

Nov 17 '05 #2
hi,

that works too! you seem to be the Einstein of the .NET world (i mean that
as a compliment, by the way)!

thanks for all your help!

--
Alvo von Cossel I of Germany
"Brendan Grant" wrote:
Am I correct in thinking that your problem is that your SplashForm is closed
almost as soon as it is drawn? If that is the case... then that is by design
of your code, you are showing it, and almost immediately closing it. One way
you might improve your process would be to do some other initialization in
between sf.Show() and sf.Close(), maybe change that section to look something
like:

sf.Show();
//show the splash
Application.DoEvents();
//allow form to paint
Browser mainBrowser = new Browser();
//Do other initialization here
sf.Close();
Application.Run(mainBrowser);

The reason for the above method is that while your SplashScreen is
displayed, you are creating a new instance of your Browser and doing any
other initialization work that needs to be done prior to its being brought to
the forefront of the application and being in charge.

Brendan
"Alvo von Cossel I" wrote:
hi,

i have a startup form (like the ones you get in Microsoft Office) that
should open for a few seconds and then close. it works when you don't include
the line in the Stativ void main that will close it:
Application.EnableVisualStyles();
SplashForm sf = new SplashForm();
sf.Show();
//show the splash
Application.DoEvents();
//allow form to paint
sf.Close();
//<<this one
Application.Run(new Browser());

but if i don't include it, the form will be open until you terminate the
application. i want it to close.

tell me if my question isn't clear enough!

cheers,

--
Alvo von Cossel I of Germany

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: salo | last post by:
hi at visual basic 6 i write this to the button1_cl1ck unload form1 form2.show
3
by: MC D | last post by:
I am trying to move my Main() procedure out of a startup form and into it's own class. I've updated the app settings to use the "Globals" class (which contains the main form). Here's what I have:...
2
by: BG | last post by:
We're having trouble writing the code to update a UI control (label.Text) from a secondary thread. We're using C# with Windows Forms. We have a main form named MainForm, a splash screen form...
0
by: | last post by:
Hi there movers & shakers, The example below demonstrates a behaviour that is anoying the tits off of me! It doesn't happen whilst debugging from the IDE only when you run the compiled exe from...
1
by: Atara | last post by:
My application starts with: Module mmcMain Public Sub Main() Debug.WriteLine("Main begin") Dim splashForm As New mcDlgs.cmcDlgSplash2 splashForm.Show() ....
4
by: John | last post by:
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...
4
by: BrianDH | last post by:
Hi I have an application with 3 windows forms. One of which I load at startup but hide, then show/hide based on users click. How can I test to see if the windows is hidden, or is at the moment...
4
by: Graham Charles | last post by:
Hello, I'm finding that if I set the "Cancel" property during the AppStartup event, the application's Splash form remains loaded. A call to the Close property of the SplashForm at that point...
4
by: Gaz | last post by:
I am having a bit of a problem getting my application to work properly. RIght here is my problem... WHen my C# windows app loads up the start form, i create a new thread and show the splash...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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: 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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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.