1

Apologies upfront for such a simplistic question. However, my google-fu skills just aren't working today and every result I'm getting is explaining how to "change the default background", which is not what I need.

What color is the default of the WPF MenuItem? Though I am interested in knowing the default color name, a better solution would be to know how to reference a Windows System brush value so that if the user changes their Windows theme settings, it would update this color, along with my menus.

RLH
  • 15,230
  • 22
  • 98
  • 182

1 Answers1

0

Do you want to get the colors or set them? Getting is easy:

SystemColors.MenuBrush
SystemColors.MenuColor

SystemColors.MenuBarBrush
SystemColors.MenuBarColor

SystemColors.MenuTextBrush
SystemColors.MenuTextColor

And if you want to be alerted when the theme changes, see the answers to this question.

To get the default MenuItem style, this will work:

var style = FindResource(typeof(MenuItem)) as Style;

Then I'm afraid you'll have to rifle through it in the watch window to see what it's setting to what.

Community
  • 1
  • 1