Click here to Skip to main content
15,920,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends
I want to show welcome screen for 5 to 10 second when application run and then login form should show.

I write below code but it is not working, Login screen is shown but welcome screen does not hide.

on main funcation.

C#
Application.Run(new frmWelcome());


On frmWelcome load event
C#
for (int i = 1; i <= 100; i++)
{
    System.Threading.Thread.Sleep(10);
    pBars.Value = i;
}
this.Hide();
frmLogin login = new frmLogin();
login.Show();


pBars is Progress Bar.

I want to show welcome screen without progress bar for 5 second and show login screen.

Thanks
Imrankhan
Posted

1 solution

Recommend you to Add Timer instead of
C#
System.Threading.Thread.Sleep(10);


You do not need Progress bar and directly compare time value with seconds.
 
Share this answer
 
v2
Comments
VJ Reddy 22-May-12 7:25am    
Good answer. 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900