当前位置: 首页>>代码示例>>C#>>正文


C# ProgressBar.BeginInvoke方法代码示例

本文整理汇总了C#中System.Windows.Forms.ProgressBar.BeginInvoke方法的典型用法代码示例。如果您正苦于以下问题:C# ProgressBar.BeginInvoke方法的具体用法?C# ProgressBar.BeginInvoke怎么用?C# ProgressBar.BeginInvoke使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.ProgressBar的用法示例。


在下文中一共展示了ProgressBar.BeginInvoke方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SetProgressBarParams

 private void SetProgressBarParams(ProgressBar pb, int minimum, int maximum, int step)
 {
     // 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 (pb.InvokeRequired)
     {
         SetProgressBarParamsCallback d = new SetProgressBarParamsCallback(SetProgressBarParams);
         pb.BeginInvoke(d, new object[] { pb, minimum, maximum, step });
     }
     else
     {
         pb.Minimum = minimum;
         pb.Maximum = maximum;
         pb.Step = step;
     }
 }
开发者ID:AlexandrSurkov,项目名称:PKStudio,代码行数:17,代码来源:ConvertationPage.cs

示例2: UpdateProgressBar

 private void UpdateProgressBar(ProgressBar bar, int maxValue, int current)
 {
     if (bar.InvokeRequired)
     {
         bar.BeginInvoke(new Action<ProgressBar, int, int>(UpdateProgressBar), bar, maxValue, current);
     }
     else
     {
         bar.Maximum = maxValue;
         bar.Value = current;
         bar.Update();
         bar.Parent.Update();
     }
 }
开发者ID:hmanjarawala,项目名称:GitRepo,代码行数:14,代码来源:Form1.cs

示例3: SetProgressBarValue

 private void SetProgressBarValue(ProgressBar pb, 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 (pb.InvokeRequired)
     {
         SetProgressBarValueCallback d = new SetProgressBarValueCallback(SetProgressBarValue);
         pb.BeginInvoke(d, new object[] { pb, value });
     }
     else
     {
         pb.Value = value;
     }
 }
开发者ID:AlexandrSurkov,项目名称:PKStudio,代码行数:15,代码来源:ConvertationPage.cs

示例4: ProgressBarPerformStep

 private void ProgressBarPerformStep(ProgressBar pb)
 {
     // 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 (pb.InvokeRequired)
     {
         ProgressBarPerformStepCallback d = new ProgressBarPerformStepCallback(ProgressBarPerformStep);
         pb.BeginInvoke(d, new object[] { pb });
     }
     else
     {
         if (pb.Value >= pb.Maximum)
         {
             pb.Value = pb.Minimum;
         }
         pb.PerformStep();
     }
 }
开发者ID:AlexandrSurkov,项目名称:PKStudio,代码行数:19,代码来源:ConvertationPage.cs


注:本文中的System.Windows.Forms.ProgressBar.BeginInvoke方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。