如何在 C# 中的 WinForm 应用程序中使用进度条 [英] how to use progress bar in WinForm Application in C#

查看:38
本文介绍了如何在 C# 中的 WinForm 应用程序中使用进度条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的应用程序中使用进度条.

i need to use Progress bar in my application.

比赛过程需要两分钟以上,但可能因情况而异

It takes more than two minutes to compete the process but it may vary based on the situation

我可以在不知道最大限制和步长值的情况下使用进度条显示应用程序的进度吗

Can i use progress Bar to show the the progress of the application without knowing the maximum limit and step value

推荐答案

如果您知道需要多长时间,您可以将最大值设置为 100 并慢慢更新它,但要确保它永远不会达到 100在它完成之前,然后当它完成时你就跳到 100.这看起来有点滑稽,但它仍然很常见.如果您根本不知道需要多长时间,我建议进度条不是解决方案,而是您想使用其他类型的动画来显示进度,而不会给人留下关于多长时间的错误印象'我会接受(我真的很讨厌进度条上升到 95% 或其他什么然后又跳回 40%).

If you have some idea about how long it will take you could just set the max to 100 and slowly update it but making sure that it'll never reach 100 before it's finished, and then when it is finished you just jump to 100. It looks a little funny, but it's fairly common still. If you have no idea at all how long it would take I'd suggest that a progress bar is not the solution, rather you'd want to use some other kind of animation to show progress without giving a false impression on how long it'll take (I really hate progress bars that go up to 95% or something and then jumps back to 40%).

这篇关于如何在 C# 中的 WinForm 应用程序中使用进度条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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