public partial class Form1 : Form
{
//....
private void timer1_Tick(object sender, EventArgs e)
{
if (this.progressBar1.Value >= 100)
{
this.timer1.Stop();
this.timer1.Enabled = false;
}
else
{
this.progressBar1.Value += 10;
this.label1.Text = Convert.ToString(this.progressBar1.Value);
}
}
//......
}
这里我使用了一个计时器来更新进度栏值。它在XP中正常工作。但在Windows7或Vista中,当进度值设置为100,但图形进度不是100!C#进度条未在Vista或Windows7中准确更新
搜索某些线程发现它的动画滞后于Vista/Windows7。
如何摆脱这个东西?
我不想使用松散VISTA/Window7的的外观和感觉:
SetWindowTheme(progressBar1.Handle, " ", " ");
你在看什么呢?它按预期对我工作... – 2010-04-06 06:33:51
显示进度= = 100%的标签完成!但进度条似乎仍然是80%或90%。不是我们想要的,对吧? – Samir 2010-04-06 06:36:32
我假设你在这里使用Windows窗体(因为你的代码中没有Dispatcher引用),我必须同意codeka,它在这里的作用就像一个魅力... 我们将需要更多的细节 – TimothyP 2010-04-06 06:44:15