Menu text color with Windows Classic (XP) system theme

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 6 years ago by Ilia Korjoukov
Version: 13.1.0582
Avatar

Hi!

I would like to ask how to override the text color in context menus, when the Windows Classic (XP) themes in active in Windows. I have dark menus and a menu text appear in black (or in a color which is chosen in the system 'Windows Color and Appearance' dialog). I would like to overide this setting completely with the white within my application.

In the Windows 7 stadart theme, I can do it by 'themes:AssetResourceKeys.MenuForegroundNormalBrushKey' and it works fine, but in the XP theme my color is ignored. Overidding SystemColors.MenuTextBrush helps only for the submenu headers.

Thanks in advance,

Ilia

[Modified 6 years ago]

Comments (2)

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Ilia,

All the themes should be using the same Actipro brush resources.  We just define the brushes differently for the various themes.  So by overidding brush resources such as MenuForegroundNormalBrushKey for each theme, it should work, at least if one of our Styles is being used on the control.  If it's not working in your scenario, there's a chance our Styles aren't being applied to the control.  If you check into that and are still having trouble, please make a new simple sample project that shows the issue, and email that to our support address.  Rename the .zip file extension so it doesn't get spam blocked.  Thanks!


Actipro Software Support

Posted 6 years ago by Ilia Korjoukov
Avatar

Hi!

Thank you for suggestion! Indeed, it occured that the Actipro style was not applied to the control. Inside a XAML file we left a style declaration,

<Style TargetType="{x:Type MenuItem}">
    <Setter Property="Focusable" Value="false" />
</Style>

 which overrided the proper style. After removing these lines everything works as expected. Thanks again!

Ilia

[Modified 6 years ago]

The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.