Microsoft KB Archive/942719

= You cannot set a button control to use the &quot;Windows XP Theme, Color Scheme, Silver&quot; style in a WPF application =

Article ID: 942719

Article Last Modified on 11/13/2007

-

APPLIES TO


 * Microsoft .NET Framework 3.0

-



SYMPTOMS
When you try to set the background style for a button control in a Windows Presentation Foundation (WPF) application, you cannot set the button control to use the &quot;Windows XP Theme, Color Scheme, Silver&quot; style.



CAUSE
This problem occurs because control templates do not perfectly support all the button control properties, such as the Background property. Therefore, some styles cannot be set successfully.



WORKAROUND
To work around this problem, create a customized template for the button control. Then, configure the application to use the customized template. After you switch the theme style, the button control continues to be displayed according to the original template. To remove all elements of the original template, set the OverridesDefaultStyle property to True in the new style.



Steps to reproduce the behavior
  In the WPF application, run the following markup:           </Trigger> </Style.Triggers> </Style> </Button.Style> </Button> </li> <li>Set the theme style to Windows XP Theme, Color Scheme, Luna or Windows XP Theme, Color Scheme, Olive. Notice that the button background turns red when the mouse points to the button.</li> <li>Set the theme style to Windows XP Theme, Color Scheme, Silver. Notice that the button background does not change when the mouse points to the button.</li></ol>

Keywords: kbexpertiseadvanced kbtshoot kbprb KB942719

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.