how to create a startup screen for a program?

  • Thread starter Thread starter Jeroen Ceuppens
  • Start date Start date
Hi,

No really but there are several techniques for this, do a google search for
"splash screen" :
http://groups.google.com/groups?hl=...e+Search&meta=group=microsoft.public.dotnet.*

Basically it's a normal form without borders that is shown while your main
form is loaded, this is from a post of this NG a while ago:

private SplashScreen splash;
public Form1()
{
splash = new SplashScreen();
splash.Show();
Application.DoEvents();
...
}

private void Form1_Load(object sender, System.EventArgs e)
{
// Do load work.
splash.Dispose();
}



The call to DoEvents() is of the most importance.

Hope this help,
 
Ignacio Machin ( .NET/ C# MVP ) said:
Basically it's a normal form without borders that is shown while your main
form is loaded, this is from a post of this NG a while ago:

private SplashScreen splash;
public Form1()
{
splash = new SplashScreen();
splash.Show();
Application.DoEvents();
...
}

Just another point to add...

If you're debugging you don't want the splash window to get in your way
while single stepping etc.

_SplashForm = new SplashForm();
#if DEBUG
// We don't want the Splash form in the way while in the debugger.
_SplashForm.TopMost = false;
#endif
_SplashForm.Show();
System.Windows.Forms.Application.DoEvents();

-- Alan
 
Back
Top