private void Bgw1_DoWork(object sender, DoWorkEventArgs e) { for (i1 = 0; i1 < 200; i1++) { Thread.Sleep(55); Bgw1.ReportProgress(i1 / 100); } }
private void BtnStart_Click(object sender, EventArgs e) { LblCount01.Text = ""; LblCount02.Text = ""; LblCount03.Text = ""; if (CbxBackgroundWorker.Checked) { Bgw1.RunWorkerAsync(); Bgw2.RunWorkerAsync(); } else { for (int i = 0; i < 201; i++) { Thread.Sleep(50); LblCount03.Text = i.ToString(); } } }