public void Progress(string phase, int StepValue)
{
DeleProgress deleProgress = new DeleProgress(privateProgress);
if (InvokeRequired == true)
{ Invoke(deleProgress, phase, StepValue); //程序有时走到这里就会卡住,有时就是好的
}
else
{
deleProgress(phase, StepValue);
}
}这个方法是供使用者调用的一个方法。请问下invoke方法那句是有什么问题吗?请大神分析下。
{
DeleProgress deleProgress = new DeleProgress(privateProgress);
if (InvokeRequired == true)
{ Invoke(deleProgress, phase, StepValue); //程序有时走到这里就会卡住,有时就是好的
}
else
{
deleProgress(phase, StepValue);
}
}这个方法是供使用者调用的一个方法。请问下invoke方法那句是有什么问题吗?请大神分析下。
请问下,您的意思是,invoke()卡住的原因是委托的方法卡住了吗?
换成BeginInvoke不卡了,但是UI还是卡住了。