Custom WPF ProgressBar To Include Upper Limit Indicator

白昼怎懂夜的黑 提交于 2019-12-13 10:40:11

问题


I would like to make a custom progress bar with upper limit property (this must be different then the maximum value of the control). When you set a value to this property a simple red line appears on the progress bar at the specified location.

Something like this would do it:


回答1:


You can Inherit From ProgressBar class in a new one, add your new DependencyProperty to it of new maximum value.

Set a new style and template for it to show the new line:

https://wpftutorial.net/HowToCreateACustomControl.html



来源:https://stackoverflow.com/questions/43385348/custom-wpf-progressbar-to-include-upper-limit-indicator

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