I need to apply a TextWrapping
in the WPF CheckBox
.
Please look at this two samples:
<CheckBox>
<TextBlock TextWrapping="Wrap"
Text="_This is a long piece of text attached to a checkbox."/>
</CheckBox>
<CheckBox>
<AccessText TextWrapping="Wrap"
Text="_This is a long piece of text attached to a checkbox."/>
</CheckBox>
If I use a TextBlock
in the Content
of the CheckBox
, the check element (vertical alignment is top) and the text displays properly, but not the accelerator.
If I use an AccessText
in the Content
of the CheckBox
, the check element displays wrong (vertical alignment is center).
How can I change the Style
of the elements to display this CheckBox
correct?
Havew you tried setting an implicit style for the AccessText, or just an AccessText style you can apply?
Here's an implicit style that would work:
If you include this in your project the AccessText should work the way you want. If you need something else, adjust the style.
If you don't want all AccessTexts to behave this way, name the style and apply it where you use it:
If you combine the two you will probably get the effect you desire.