【发布时间】:2011-02-14 02:39:30
【问题描述】:
朋友们,感谢您的宝贵时间! WPF 中的以下代码存在问题。我使用 ProgressBar 和 Animation 来显示值更改的进度。当 Animation 完成后,我尝试将值重置为 0 ,以便 ProgressBar 可以从 0 开始新的 Animation再次变为100。但结果是我无法将值设置为0,似乎无论我如何尝试都将永远是100!!!!!!! 能否请您给我一些想法,谢谢!
pbStatus.Value = 0;//Promblem!! pbStatus is a ProgressBar
Duration dr = new Duration(TimeSpan.FromSeconds(2));
DoubleAnimation da = new DoubleAnimation(100, dr);
pbStatus.IsIndeterminate = false;
pbStatus.Visibility = Visibility.Visible;
pbStatus.BeginAnimation(ProgressBar.ValueProperty, da);
【问题讨论】:
标签: wpf progress-bar