private void button1_Click(object sender, EventArgs e) { progressBar1.Maximum = 100; progressBar1.Step = 1; progressBar1.Value = 0; backgroundWorker1.RunWorkerAsync(); CorelDRAW.Application cdr = new CorelDRAW.Application(); cdr.OpenDocument(@"d:\xxx.cdr", 1); cdr.AppWindow.WindowState = cdrWindowState.cdrWindowMaximized; } private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { BackgroundWorker worker = sender as BackgroundWorker; for (int i = 1; i <= 10; i++) { // Perform a time consuming operation and report progress. System.Threading.Thread.Sleep(1000); worker.ReportProgress(i * 10); } } private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e) { progressBar1.Value = e.ProgressPercentage; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)