第一步:如何在线程中打开窗体
SendEmailProgress progress=new SendEmailProgress();
//添加窗体关闭事件
progress.Closing += (s, ev) =>
{
if (progress.IsEnabledCloseForm)
{
}
else
{
ev.Cancel = true;//关闭窗体
}
};
Control.CheckForIllegalCrossThreadCalls = false; //在这个类中我们不检查跨线程的调用是否合法
Thread thread = new Thread(new ParameterizedThreadStart(ShowCommonProgressFormDialog));
thread.Start();
if (isFirst)
{
Thread.Sleep(5000);
isFirst = false;
}
progress.WriteMessage("","","");//
private static void ShowCommonProgre