Ejemplo n.º 1
0
 /// <summary>
 /// 回報進度。
 /// </summary>
 /// <param name="progress">與上次進度的差異量。</param>
 public void ReportProgress(int progress)
 {
     if (InvokeRequired)
     {
         _progress.Invoke(new InvokeInt(ReportProgress), progress);
     }
     else
     {
         _progress.Value += ((_progress.Value + progress) > 100 ? 100 : progress);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// 设置单步移动
 /// </summary>
 /// <param name="value"></param>
 public void SetStep(int value)
 {
     if (barProgress.InvokeRequired)
     {
         SetBar pSetBar = SetStep;
         barProgress.Invoke(pSetBar, value);
     }
     else
     {
         barProgress.Step = value;
     }
 }
Ejemplo n.º 3
0
 public static void SetProgressBarValue(this ProgressBarX progressBar, int value, string msg = "")
 {
     progressBar.Invoke(new Action(() => {
         progressBar.Value = value;
         if (string.IsNullOrEmpty(msg))
         {
             progressBar.Text        = msg;
             progressBar.TextVisible = true;
         }
     }));
 }