PDA

View Full Version : سوال: اجرا نشدن دوباره کنترل background worker



hamid_73
شنبه 13 اردیبهشت 1393, 09: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();
}

hamid_73
شنبه 13 اردیبهشت 1393, 15:16 عصر
کسی بلد نیست؟؟؟