Thursday, August 11, 2005

Splash Screen for C#.Net windows apps.

There is no built-in support for the splash screen in the Microsoft.NET win form applications. However, with the help of threading, we can create a splash screen.

We can create a splash screen by creating a form with

no title bar (by setting its FormBorderStyle to None),
making it not appear in the taskbar (by setting its ShowInTaskbar property to false),
making it the top most form (by setting) its TopMost property to true,
and making it appear on the center of the screen (by setting its StartupPosition as CenterScreen).

We can show this splash form when the main application is loading.

//formload method of my main application

private void Form1_Load(object sender, System.EventArgs e)
{
this.Hide();

Splash frmSplash = new Splash();
frmSplash.Show();
frmSplash.Update();
Thread.Sleep(3000);
frmSplash.Close();
this.Visible = true;

}

//frmSplash is an instance of our Splash Screen

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home