hamid_73
شنبه 13 اردیبهشت 1393, 10:50 صبح
سلام دوستان
من کنترل back ground worker رو کنسل می کنم و وقتی می خوام دوباره اونو اجرا کنم اجرا نمییشه و ارور میده چرا؟؟
اینم کداش
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
while (true)
{
if (backgroundWorker1.CancellationPending)
{
e.Cancel = true;
break;
}
}
}
private void btn_Print_Click(object sender, EventArgs e)
{
backgroundWorker1.RunWorkerAsync();
process1.WaitForExit();
backgroundWorker1.CancelAsync();
}
من کنترل back ground worker رو کنسل می کنم و وقتی می خوام دوباره اونو اجرا کنم اجرا نمییشه و ارور میده چرا؟؟
اینم کداش
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
while (true)
{
if (backgroundWorker1.CancellationPending)
{
e.Cancel = true;
break;
}
}
}
private void btn_Print_Click(object sender, EventArgs e)
{
backgroundWorker1.RunWorkerAsync();
process1.WaitForExit();
backgroundWorker1.CancelAsync();
}