Action aprint = new Action(pl.PrintCostCenter);
IAsyncResult re = aprint.BeginInvoke(null, null);
while (true)
{
this.txtBox.Text = "正在打印...";
if (re.IsCompleted)
{
this.txtBox.Text = "打印完成";
break;
}
System.Threading.Thread.Sleep(1000);
}
代码如上面, 当我异步调用了PrintCostCenter方法后. "正在打印..." 无法显示. 但异步调用完成后 "打印完成" 可以显示. 还请高手指点
}));
Application.DoEvents();