开发者

Access key not working on CheckBox after applying style

开发者 https://www.devze.com 2023-03-27 05:39 出处:网络
Ive applied some styling on CheckBoxes in my app to write default values to some its properties. <Style

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

0

精彩评论

暂无评论...
验证码 换一张
取 消