这个简单,先用窗体打开进度条的同事,进程委托打开需要打开的窗体。
``` private delegate void MethodInvoker();
private void F_Login_Load(object sender, EventArgs e)
{
Thread thread = new Thread(threadFrom);//创建新线程
thread.Start();
/***开始加载任务**/
/***结束时销毁线程***/
thread.Abort();
}
public void threadFrom()
{
MethodInvoker MethInvo = new MethodInvoker(LoadForm);
BeginInvoke(MethInvo);
}
void LoadForm()
{
F_ShapingMachine frmShap = new F_ShapingMachine();
frmShap.Show();
}