如何在不知道进度动画的完成度的情况下显示进度动画?

发布于 2024-08-18 08:50:38 字数 125 浏览 3 评论 0原文

在 WPF 应用程序中,我需要向用户显示某个进程正在进行中,需要等待。我不需要展示这个过程的完成度的特定百分比,而且,我并不完全知道。

有什么方法可以做到呢?进度条的一些特殊设置或者也许还有其他常见的方式来显示这种动画?

In a WPF application I need to show user that some process is in progress and one should wait. I don't need to show particular percentage of completeness of this process, moreover, I don't exactly know it.

What is the way to do it? Some special settings of the progress bar or maybe there are other common ways to show animation of this kind?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

じ违心 2024-08-25 08:50:38

使用 ProgressBar 并将 IsInminated 设置为 true。这是表示进展正在发生的标准方式,但无法衡量甚至估计。

Use a ProgressBar and set IsIndeterminate to true. This is the standard way of signaling that progress is occurring, but that it cannot be measured or even estimated.

温柔一刀 2024-08-25 08:50:38
Dim aniOpacity As New DoubleAnimation()

aniOpacity.From = 0.1
aniOpacity.To = 1
Dim timeSpanDuration As New TimeSpan(0, 0, lngTakt / 1000)
aniOpacity.Duration = New Duration(timeSpanDuration)

Me.aProgressBar.BeginAnimation(ProgressBar.ValueProperty, aniOpacity)

我不确定这是否是您搜索的内容。但我不知道,如果你不知道进度的状态,你想如何设置进度条。

// 编辑:抱歉,现在我知道你的意思了。您可以将代码放入循环中。如果你完成了你的过程,你就停止循环。

Dim aniOpacity As New DoubleAnimation()

aniOpacity.From = 0.1
aniOpacity.To = 1
Dim timeSpanDuration As New TimeSpan(0, 0, lngTakt / 1000)
aniOpacity.Duration = New Duration(timeSpanDuration)

Me.aProgressBar.BeginAnimation(ProgressBar.ValueProperty, aniOpacity)

I not sure, if this is, what you searched. But I don't know, how you want to set a progressbar, if you don't know the state of the progress.

// EDIT: Sorry, now i know what you mean. You can put the code in a loop. If you are finished with your process you stop the loop.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文