TProgressBar从来没有填满 - 似乎正在更新太快? [英] TProgressBar never fills up all the way - seems to be updating too fast?

查看:578
本文介绍了TProgressBar从来没有填满 - 似乎正在更新太快?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

Windows 7 Aero主题进度栏错误?


自Windows Vista以来,我注意到Delphi中的TProgressBar有一个错误/问题。



问题是进度条从来没有似乎填满100%,有时候在进度条被认为是最大值,即100%



之前,可能会达到70% - 80%,我已经在各种网站上阅读,而且,进度条已经完成其操作。但是看起来Delphi VCL中出现了一个错误,它没有准确地渲染进度条,所以当它似乎是完整的,但实际上并不是这样,这是因为进度条的绘制是不准确的。



如果上述是真实的,这似乎是一个有效的原因 - 我没有找到解决方案。无论涉及TProgressBar的操作如何,它都不会填满100%,只能填充75%的方式。



如何让TProgressBar准确填写要添加,我已经尝试用来自JVCL的进度条替换TProgressBar,那些非标准VCL组件正常工作。所以这不是一个问题,我正在处理进度,它是Delphi或Windows - 或两者。



是的,我可以使用所选的替代方法,但如果可能我想知道如何修正标准的TProgressBar。



谢谢Craig。

解决方案

这是Vista主题的功能。解决此功能的唯一已知方法是在更新期间向后退。



每次将进度条计数器设置为N后,立即将其设置为N-1



Delphi代码没有任何问题,这是常用控件的一个功能。


Possible Duplicate:
Windows 7 Aero Theme Progress Bar Bug?

Ever since Windows Vista, I have noticed a bug/problem with the TProgressBar in Delphi.

The problem is the progressbar never seems to fill up to 100%, sometimes it gets to maybe 70% - 80% before the progressbar thinks its hit the max, i.e 100%

I have been reading on various websites and infact, the progressbar has complete its operation. But it seems that there is a bug in the Delphi VCL which is not rendering the progressbar accurately, so when it appears to be complete but is actually not, this is because the painting of the progressbar is not accurate.

If the above is true, which seems a valid reason - I have not found a solution to this. Whatever the operation which involves a TProgressBar, it never fills up 100%, it only fill maybe 75% of the way.

How can I get the TProgressBar to fill up accurately?

To add, I have tried replacing the TProgressBar with say a progressbar from the JVCL and those non standard VCL components work correctly. So it is not a problem with how I am dealing with the progress, it is either Delphi or Windows - or both.

Yes, I could just use said alternative but if possible I would like to know how to fix the standard TProgressBar.

Thanks, Craig.

解决方案

This is a feature of Vista themes. The only known way to work around this feature is to go backwards during an update.

Every time you set the progress bar counter to N immediately afterwards set it to N-1.

There's nothing wrong with the Delphi code, it's a feature of the common control.

这篇关于TProgressBar从来没有填满 - 似乎正在更新太快?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆