1

Whenever I try to change the background color to a menu adding the following code to the app.xml

    <Style TargetType="MenuItem">
        <Setter Property="Background" Value="#FF9B9B9B" />
    </Style>

I get this lighter shade of gray around the menu, which color isn't set by the background property:

enter image description here

I know there are similar questions around, but the answers I've found haven't helped me.

H.B.
  • 166,899
  • 29
  • 327
  • 400
hikizume
  • 578
  • 11
  • 25
  • 1
    I don't see your point. Is the background not set or what? – Daniel Sep 05 '11 at 11:49
  • It has this border in a lighter shade of gray. Same with the separator. Everything should be in the same color but I can't find a way to set up the color of that border thing – hikizume Sep 05 '11 at 14:33

1 Answers1

1

That sort of thing is coded into the various ControlTemplates for MenuItems. You will probably have to create your own. (You could copy the defaults and edit them to your liking though)

Community
  • 1
  • 1
H.B.
  • 166,899
  • 29
  • 327
  • 400
  • The link led me to create a style which is applied to the menuItem. I edited the style and changed the background and got the same result, since it's the same background property. The menuItem still has a border in another color which I can't seem to get ahold of. – hikizume Sep 06 '11 at 07:20
  • Somewhere buried in those +300 lines of code there's another parameter `` which changes the color. Thanks! – hikizume Sep 06 '11 at 07:34
  • @hikizume: As i said, there are various ControlTemplates, each one for a different role of the MenuItem, somewhere there should one which references this resource in its template (it has the component-id `SubmenuHeaderTemplateKey`). – H.B. Sep 06 '11 at 11:06