1:Initialize 方法最开始:
Thread thread = new Thread(initForm);
thread.Start();
该方法最后:
thread.Abort();
(可以控制要显示多久,中间sleep)
2:
private void initForm()
{
using (LoadForm frm = new LoadForm())
{
frm.ShowDialog();
}
}
3:LoadForm 设置背景图片 无边框
如果需要控制显示文字 加载中.....
或者其他个性化显示,可以用timer计时器
如:
int timePass = 0;
private void timer1_Tick(object sender, EventArgs e)
{
if ((timePass == 300) || (timePass == 1300) || (timePass == 2300) || (timePass == 3300) || (timePass == 4300))
{
// this.lblLoad.Text = "系统加载中.";
Application.DoEvents();
}
if ((timePass == 600) || (timePass == 1600) || (timePass == 2600) || (timePass == 3600) || (timePass == 4600))
{
// this.lblLoad.Text = "系统加载中...";
Application.DoEvents();
}
if ((timePass == 1000) || (timePass == 2000) || (timePass == 3000) || (timePass == 4000) || (timePass == 5000))
{
//this.lblLoad.Text = "系统加载中.......";
Application.DoEvents();
}
timePass += 100;
}
private void FormLoad_Load(object sender, EventArgs e)
{
timePass = 0;
this.timer1.Start();
}