//EventLog myLog = new EventLog(); public FrmProgress() { InitializeComponent(); _setProgressText = SetProgressBarText; _setProgressValue = SetProgressBarValue; //myLog.Source = "ForLABLog"; }
public FrmProgress(MorbidityForecast forecast, InventoryAssumption invAssumption) { //this._morbidityForm = morbidityForm; this._forecast = forecast; this._invAssumption = invAssumption; InitializeComponent(); _setProgressText = new SetTextCallBack(SetProgressBarText); _setProgressValue = new SetProgressBarCallBack(SetProgressBarValue); }
private void SetProgressBar(int percentage) { try { if (ProgressBar1.InvokeRequired) { SetProgressBarCallBack c = SetProgressBar; Invoke(c, percentage); } else { ProgressBar1.Value = percentage; } } catch { } }
private void SetProgress(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.progressBar.InvokeRequired) { SetProgressBarCallBack d = new SetProgressBarCallBack(SetProgress); this.Invoke(d, new object[] { value }); } else { this.progressBar.Maximum = value; } }
private void SetProgressBar(int max, int current) { if ( this.progressBar1.InvokeRequired) { SetProgressBarCallBack s = new SetProgressBarCallBack(SetProgressBar); this.Invoke(s, new object[] { max, current }); } else { this.progressBar1.Maximum = max; this.progressBar1.Step = 1; this.progressBar1.PerformStep(); } }