0

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?

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
0x49D1
  • 8,505
  • 11
  • 76
  • 127

1 Answers1

0

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

stukselbax
  • 5,855
  • 3
  • 32
  • 54
  • ...may be there is something else making it ignoring access key....Thank you for check, i'll recheck all that when i'll be near that code. – 0x49D1 Aug 09 '11 at 15:00
  • ..By the way, there were problems with our custom styling. Thanks. – 0x49D1 Aug 31 '11 at 13:12
  • If this is not a secret, which lines of code changed the normal behavior? – stukselbax Sep 01 '11 at 04:23
  • Sure not..But that was my mistake..I had a style defined for combobox where i used textblock to show combo's text. – 0x49D1 Sep 01 '11 at 06:06