// Callbacks public void SetProgressBarMax(ProgressBar p, int max) { if (p.InvokeRequired) { SetProgressBarMaxCallback d = new SetProgressBarMaxCallback(UpdateProgressBar); this.Invoke(d, new Object[] { p, max }); } else { p.Maximum = max; } }
private void SetProgressBarMax(int max) { if (progressBarFilesCompleted.InvokeRequired) { SetProgressBarMaxCallback cb = new SetProgressBarMaxCallback(SetProgressBarMax); Invoke(cb, new object[] { max }); } else { progressBarFilesCompleted.Maximum = max; } }
private void SetProgressBarMax(int count) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (this.pb.InvokeRequired) { SetProgressBarMaxCallback d = new SetProgressBarMaxCallback(SetProgressBarMax); this.Invoke(d, new object[] { count }); } else { this.pb.Maximum = count; } }
private void SetProgressBarMaxValue(int value) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (this.pgBar.InvokeRequired) { SetProgressBarMaxCallback d = new SetProgressBarMaxCallback(SetProgressBarMaxValue); this.Invoke(d, new object[] { value }); } else { pgBar.Maximum = value; } }
private void SetMax(int max) { // InvokeRequired required compares the thread ID of the // calling thread to the thread ID of the creating thread. // If these threads are different, it returns true. if (progressBar.InvokeRequired) { SetProgressBarMaxCallback d = new SetProgressBarMaxCallback(SetMax); this.Invoke(d, new object[] { max }); } else { progressBar.Maximum = max; Reset(); } }