如何在 WinForms 中制作无休止的进度条? [英] How can I make an endless progressbar in WinForms?

查看:37
本文介绍了如何在 WinForms 中制作无休止的进度条?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道一个动作需要多长时间,我想在对话框中向用户显示一个进度条.我试过使用 System.Windows.Forms.ProgressBar 但它似乎不支持它.

I don't know how long an action could take and I want to display a progress bar to the user in a dialog box. I've tried using System.Windows.Forms.ProgressBar but it doesn't seem to support it.

我想要的一个例子是 Windows 在 Internet 上寻找新驱动程序时向您显示的进度条.它只是在进度条上有三四个条"来回走马灯样式.

An example of what I'd want is the progress bar that windows shows you when it's looking for new drivers on the internet. It's just got three or four 'bars' going back and forth marquee style on the progress bar.

我该怎么做?

推荐答案

System.Windows.Forms.ProgressBar 有一个名为 Style 的属性.将Style设置为Marquee即可达到你想要的效果.

System.Windows.Forms.ProgressBar has a property called Style. Setting Style to Marquee will achieve the effect your looking for.

​​Divo 指出了 Marquee 样式 仅在

Divo points out the Marquee Style is only available on

Windows XP 家庭版、Windows XP Professional x64 版、Windows Server 2003

Windows XP Home Edition, Windows XP Professional x64 Edition, Windows Server 2003

评论提供了更多信息,表明只要您使用 .NET 2.0 或更高版本,这似乎在任何地方都可以使用.

The comments provide even more information indicating that this appears to work everywhere as long as you're using .NET 2.0 or higher.

这篇关于如何在 WinForms 中制作无休止的进度条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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