private void ProgressBarSetValue(int val) { if (this.progressBar1.InvokeRequired) { ProgressBarSetValueCallback d = new ProgressBarSetValueCallback(ProgressBarSetValue); this.Invoke(d, new object[] { val }); } else { progressBar1.Value = val; } }
void ProgressBarSetValue(int value) { if (DownloadProgressBar.InvokeRequired) { ProgressBarSetValueCallback d = new ProgressBarSetValueCallback(ProgressBarSetValue); Invoke(d, new object[] { value }); } else { DownloadProgressBar.Value = value; } }