Ive applied some styling on CheckBoxes
in my app to write default values to some its properties.
<Style
TargetType="{x:Type CheckBox}">
<Setter
Property="HorizontalAlignment"
Value="Left" />
<Setter
Property="Margin"
Value="2" />
<Setter
Property="MinHeight"
Value="22"开发者_开发问答 />
</Style>
But that ruined the access keys, now Content
looks like for example: _Is Active and not Is Active with access on ALT hold+I. How to make style work with access keys working too?
Tested it just now, VS'10, WPF 4.0, SP1. worked fine. Alt+I changed checkbox
state. code for test:
<Window.Resources>
<Style TargetType="{x:Type CheckBox}">
<Setter
Property="HorizontalAlignment"
Value="Left" />
<Setter
Property="Margin"
Value="2" />
<Setter
Property="MinHeight"
Value="22" />
</Style>
</Window.Resources>
<CheckBox Content="_IsActive" />
Maybe you forgot to specify some aspects?
Or I don't understand something
精彩评论