Adam S
Adam S

Reputation: 9235

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/thread/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?

Upvotes: 1

Views: 694

Answers (1)

bitbonk
bitbonk

Reputation: 49609

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 -->

Upvotes: 1

Related Questions