change color of red box on tri-state checkbox
I'm trying to get the green box that appears on the second click of a tri-state checkbox to be red, and also to fill up the box.
I found an article here that demonstrates a little bit about using templates to do this: http://social.msdn.microsoft.com/Forums/en-US/wpf/threa开发者_运维知识库d/98cf8a65-f4ca-4ff5-9851-c2989b91a013
However, I can't figure out how to interpret all that. I only understand a few of the things in that template and don't know how to get my red box. Can anyone help, and also tell me how you knew what to do?
You would change this part of the original ControlTemplate:
<Trigger Property="IsChecked" Value="{x:Null}">
<Setter TargetName="path"
Property="Data"
Value="M 0 2.5 A 5 2.5 0 1 1 5 5
L 5 8 M 5 10 L 5 10" />
<Setter TargetName="path"
Property="Stroke"
Value="Red" /> <!-- Red now instead of Blue -->
精彩评论