WPF custom slider drawed by yourself

谁说胖子不能爱 提交于 2019-12-23 18:14:51

问题


This is my first question on stack-overflow so don't kick it))

I have a problem trying to create a Mac-style slider control. I have found this solution and I have implemented it in my solution, but it still doesn't satisfy me cause I need a more universal solution.

Basically I need to create this slider control with the help of four pictures - right, left and center(the rest of) pictures of track bar and one picture for thumb. These are PNG files.

Could I style default WPF slider to support such resource-oriented behavior? I'm really astonished that all samples includes templates for style but no one supports something like

<TrackBarLeft>
   <Image for left>
</TrackBarLeft>
....

Could any one give me a solution for this problem? Thank you very much


回答1:


Sams "WPF Control Development Unleashed" has some guidelines on this. Check out Chapter 5: Using Existing Controls - it has an example based on a scrollbar - it might be useful.



来源:https://stackoverflow.com/questions/8338837/wpf-custom-slider-drawed-by-yourself

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