public void AsynchronousExecutionFinished() { if (!this.InvokeRequired) { progressBar1.Value = 100; lblProgresso.Text = String.Empty; this.Enabled = true; MessageBox.Show("Geração do arquivo concluída com sucesso!"); } else { AsynchronousExecutionFinishedDelegate executionFinished = new AsynchronousExecutionFinishedDelegate(AsynchronousExecutionFinished); this.BeginInvoke(executionFinished); } }