首页 > 代码库 > c# backgroundworker 与invoke
c# backgroundworker 与invoke
1.BackgroundWorker b = new BackgroundWorker();
b.WorkerReportsProgress = true;
b.ProgressChanged += new ProgressChangedEventHandler(UpdateProcess);
b.DoWork += new DoWorkEventHandler(DoBuild1);
if (b.IsBusy != true)
{
b.RunWorkerAsync();
}
2.this.Invoke((EventHandler)(delegate
{
outputListbox(SrcMagName + SrcSlotName + "--" + DstMagName + DstSlotName + "-ok");
toolStripStatusLabel1.Text = SrcMagName + SrcSlotName + "--" + DstMagName + DstSlotName + "-ok";
}));
c# backgroundworker 与invoke