且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Windows 7 Aero 主题进度条错误?

更新时间:2023-12-06 12:33:58

和进度条的动画有关.如果您的进度条为 0%,并且您将其设置为 100%,则它不会跳到那里,而是动画进度条平滑填充.如果这太慢,您将在进度条完成动画之前完成.因此,即使您已经将其设置为 80、90 和 100%,动画仍然滞后.

It has to do with the animation of the progress bar. If your progress bar is at 0% and you set it to 100% then it will not jump there, but animate the progress bar smoothly filling up. If this is too slow, you will be done before the progress bar finished animating. So even though you have already set it to 80, 90 and 100%, the animation still lags behind.

我从未找到关闭此功能的方法,但我有一个解决方法.只有当您增加进度条时,动画才会完成.如果你向后移动它,它会立即跳到那个位置.因此,如果我希望进度条位于 x% (x != 100),那么我将其移至 x+1,然后移至 x.如果我希望它达到 100%,我将它移动到 100、99 和 100%.(或者你使用的任何值,你都明白了.)这工作得足够快,以至于不可见,你也可以将此代码保留在以前的 Windows 版本中(尽管我不这样做).

I never found a way to turn this off, however I have a workaround. The animation is only being done if you increment the progress bar. If you move it backwards, it will immediately jump to that position. So if I want the progress bar to be at x% (x != 100) then I move it to x+1 and then to x. If I want it at 100% I move it to 100, 99 and 100%. (Or whatever values you use, you get the idea.) This works fast enough to not to be visible, and you can leave this code in for previous Windows versions as well (though I don't).