private void StartButton_Click(object sender, EventArgs e) { if (!T2.IsBusy) { progressBar1.Visible = true; T2.RunWorkerAsync(); } }
private async void RunBackgroundWorker() { ProgressBar1.Visible = true; UseWaitCursor = true; if (T2.IsBusy) { T2.CancelAsync(); } else if (!T2.IsBusy) { T2.RunWorkerAsync(); } }