如何制作一个带启动屏幕的窗体
来源:岁月联盟
时间:2005-03-16
// ( C# )
protected override void OnLoad ( System.EventArgs e )
{
//make load take a long time
Thread.Sleep(2000);
base.OnLoad(e);
}
然后在Main中加入这样的代码:
[STAThread]
static void Main()
{
SplashScreen splashForm = new SplashScreen();
splashForm.Show();
Form1 mainForm = new Form1() ;
mainForm.Load += new EventHandler(splashForm.MainScreen_Load);
Application.Run(mainForm);
}
不要忘了加上对Threading的引用: using System.Threading;