using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace sharpcomparer { public partial class ProgressDialog : Form { private BackgroundWorker worker; public ProgressDialog(BackgroundWorker worker) { InitializeComponent(); this.worker = worker; } public string Message { set { label1.Text = value; } } public int Progress { get { return progressBar1.Value; } set { progressBar1.Value = value; } } private void button1_Click(object sender, EventArgs e) { worker.CancelAsync(); button1.Enabled = false; } } }