How do I make a marquee progress bar in WPF?

有些话、适合烂在心里 提交于 2020-01-20 18:18:25

问题


In Winforms I could set the ProgressBarStyle of a progress bar to Marqee, and that would have the progress bar incriment on its own without having to be set, for processes where I don't know how long its going to take, and no good way to report back to the UI.

I would like to do the same in WPF, but I can't find a way to pull it off short of hosting a winform progress bar, which seems counter productive.

How can I pull this off in WPF? Do I have to host a winform progress bar?


回答1:


I think you simply want to set the IsIndeterminate property of the ProgressBar to true. (See this article, which also has a nice example of a fancy circular progress indicator.)




回答2:


Try the following

<ProgressBar 
  IsIndeterminate="True"
  Orientation="Horizontal" />

The key is the oddly named IsIndeterminate attribute. Setting this to true means Marque



来源:https://stackoverflow.com/questions/638650/how-do-i-make-a-marquee-progress-bar-in-wpf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!