private void cancel_Click(object sender, EventArgs e) { if (backgroundWorker1.WorkerSupportsCancellation == true) { // Cancel the asynchronous operation. backgroundWorker1.CancelAsync(); ModifyProgressBarColor.SetState(progressBar1, 2); } }
private void start_Click(object sender, EventArgs e) { if (this.sourcePath != string.Empty && this.destinationPath != string.Empty) { ModifyProgressBarColor.SetState(progressBar1, 1); progressBar1.Maximum = 100; progressBar1.Step = 1; progressBar1.Value = 0; backgroundWorker1.RunWorkerAsync(); } else { resultLabel.Text = "Browse Source And Destination Folders to start the copying process!"; } }