WPF自定义的滑块drawed自己 [英] WPF custom slider drawed by yourself
问题描述
这是我对堆栈溢出的第一个问题,所以不要踢它))
This is my first question on stack-overflow so don't kick it))
我有一个问题,试图创建一个Mac风格的滑块控件。我找到了此解决方案,并且在我的解决方案中实现了它,但它仍然不满足我,因为我需要一个更通用的解决方案。
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.
基本上,我需要创建这个滑块控件与四个图片的帮助 - 右,左和中心其余)轨道栏的图片和一张图片的拇指。这些是PNG文件。
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.
我可以风格默认的WPF滑块来支持这种面向资源的行为吗?
我真的很惊讶,所有的样品都包括样式的模板,但没有人支持像
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
推荐答案
SamsWPF Control Development Unleashed对此有一些指导。查看第5章:使用现有的控件 - 它有一个基于滚动条的示例 - 它可能是有用的。
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.
这篇关于WPF自定义的滑块drawed自己的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!