Reputation: 2626
I am doing win form project.(C#). In that project i am willing to add welcome screen. So i created a welcome screen. But, It want to show a few minitute and automatically closed and open login screen.
System.Threading.Thread.Sleep(1500);
LogIn n = new LogIn();
n.Show();
I try this code in form shown,load, activate events. BUt no use. Any one know what to do?.
Upvotes: 3
Views: 4084
Reputation: 40746
In my opinion, you cannot create a splash screen in .NET for a .NET application:
The purpose of a splash screen is to distract users from long waiting times, until the application has been loaded, started and initialized.
Since a .NET application itself already has some startup time, there is no splash screen available within this time.
My solution
So in my applications, I am doing it the following way:
The inter-process communication is done the following way:
I know this is not 100% perfect, it was the most suitable solution I came up since I started developing .NET applications, years ago.
Upvotes: 1
Reputation: 8410
Add a line for splash screen in Program.cs. Run a timer in splash screen and close the form.
private static void Main() {
Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new FSplash()); // This is your splash form << added Application.Run(new FMain()); }
Upvotes: 2