WPF Checkbox style making focus border behave strangly?

Didn't change much but I think it looks ok.

Up vote 0 down vote favorite share g+ share fb share tw.

I am using WPF with a style sheet. In my Style, I have been trying to customized the look of the dotted focus border for a CheckBox. I need the focus border to only draw around the square an not the entire control.

I set my style width to 15 and the dotted border is correct, but does not surround the square, its off to the side. I have included the style. Thanks for the help.

Style Sheet fragment: wpf focus styles resourcedictionary link|improve this question edited Aug 13 '11 at 16:24Dave Clemmer1,77331030 asked Oct 21 '10 at 10:41SetiSeeker8731620 63% accept rate.

Thanks for the help! – SetiSeeker Oct 21 '10 at 12:22 You're welcome :) – Meleak Oct 21 '10 at 12:25.

Use Blend or XAMLWriter using one the the techniques shown here to get the ControlTemplate of a CheckBox. Look at how and where the "square" is defined - I am sure that you will see that it has a margin and/or padding and/or other formatting applied to it. At that point, you can use that information to implement your Style.

It's unclear from your snippet if you are actually implementing the ControlTemplate of the CheckBox, but that may be easiest. Oh, and FYI - in WPF, they are called ResourceDictionaries, not style sheets.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions