public void SetMaxProgressValue(int max) { this.Invoke((MethodInvoker)delegate { this.progressBar1.Maximum = max; this.progressBar1.Value = 0; }); }