private void IncrementProgress() { if (this.progressBar1.InvokeRequired) { IncrementProgressCallback cb = new IncrementProgressCallback(IncrementProgress); this.Invoke(cb, new object[] { }); } else { this.progressBar1.PerformStep(); } }
/// <summary> /// Thread-safe method for incrementing (or decrementing) the progress bar. /// </summary> private void IncrementProgress(int value) { if (this.prgUpdate.InvokeRequired) { IncrementProgressCallback prgCallback = new IncrementProgressCallback(IncrementProgress); this.Invoke(prgCallback, new object[] { value }); } else { prgUpdate.Value += value; prgUpdate.Refresh(); } }
private void IncrementProgress() { if (progressBar1.InvokeRequired) { var cb = new IncrementProgressCallback(IncrementProgress); Invoke(cb, new object[] { }); } else progressBar1.PerformStep(); }