本文整理汇总了C#中System.Windows.Forms.ProgressBar.Update方法的典型用法代码示例。如果您正苦于以下问题:C# ProgressBar.Update方法的具体用法?C# ProgressBar.Update怎么用?C# ProgressBar.Update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.ProgressBar
的用法示例。
在下文中一共展示了ProgressBar.Update方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
}
}
示例2: SetProgressNoAnimation
/// <summary>
/// Used to circumvent the animations used on progress bars in Windows 7 and up.
/// Includes a Update() call to take care of redraw.
/// </summary>
/// <param name="pb">The progress bar to be updated</param>
/// <param name="value">Value from 0 to 100 for the progress bar</param>
public static void SetProgressNoAnimation(ProgressBar pb, int value)
{
// To get around the progressive animation, we need to move the
// progress bar backwards.
if (value == pb.Maximum)
{
// Special case as value can't be set greater than Maximum.
pb.Maximum = value + 1; // Temporarily Increase Maximum
pb.Value = value + 1; // Move past
pb.Maximum = value; // Reset maximum
}
else
{
pb.Value = value + 1; // Move past
}
pb.Value = value; // Move to correct value
pb.Update();
}
示例3: InvokeProgressBarUpdate2
private void InvokeProgressBarUpdate2(ProgressBar Object)
{
Object.Update();
}
示例4: progressBarVerificacao
/* INICIO DA VERIFICAÇÃO E LIMPEZA */
public void progressBarVerificacao(int valor, ProgressBar a)
{
a.Value = 0;
a.Update();
a.Visible = true;
a.Maximum = valor;
}