本文整理匯總了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;
}