先将myFrmSplash的进度条和进条标签的Modifiers设为Public
后在主界面的LOAD事件处理程序编写代码
private void frmMain_Load(object sender, EventArgs e)
{
frmSplash myFrmSplash = new frmSplash();
myFrmSplash.Show();
myFrmSplash.Update();
for (int i = 0; i <= 100; i++)
{
myFrmSplash.pbCount.Value = i;
myFrmSplash.lblCount.Text = i.ToString() + "%";
myFrmSplash.Update();
Thread.Sleep(10);
}
myFrmSplash.Close();
......
}
效果图:
感觉效果很好,在此深谢同事庞老师为此提供了很好的解决方案。