WPF button background in windows 7 -


Before the windows XP and the background of the wpf button was always set, but background from Windows 7 is always blue Is set to. How can I fix it?

You will need to create your own template for the button (I think it's just hover color Which you are struggling with, not the original color, which follows the background property).

Here is a very simple button template, which can help you to get started. Settings will be required to suit backbirds and forbes. (And they are back and rest of the rest of the application, so they look back in this example)

   & Lt; Setter property = "click mode" value = "press" /> & Lt; Setter Property = "Text Block. Text Dissection" Value = "Wrap" / & gt; & Lt; Setter Property = "Borderbrush" Value = "#E9DBA" /> & Lt; Setter property = "foreground" value = "{static resource backbish}" /> & Lt; Setter Property = "Background" Value = "{StaticResource Forbesch}" / & gt; & Lt; Setter Estates = "Template" & gt; & Lt; Setter.Value & gt; & Lt; ControlTemplate TargetType = "{x: type button button}" & gt; & Lt; Border x: name = "border" background = "{TemplateBinding background}" BorderBrush = "{TemplateBinding BorderBrush}" BorderThickness = "2" CornerRadius = "2" SnapsToDevicePixels = "false" RenderTransformOrigin = "0.5.0.5" TextBlock Foreground = "{TemplateBinding foreground}" & gt; & Lt; ContentPresenter margin = "2" HorizontalAlignment = "center" VerticalAlignment = "center" /> & Lt; / Border & gt; & Lt; ControlTemplate.Triggers & gt; & Lt; Trigger Property = "Issued" value = "True" & gt; & Lt; Setter TargetName = "Border" Property = "RenderTransform" & gt; & Lt; Setter.Value & gt; & Lt; ScaleTransform ScaleX = "0.975" scaleY = "0.975" /> & Lt; /Setter.Value> & Lt; / Setter & gt; & Lt; / Catalyst & gt; & Lt; Trigger Property = "Iceded" value = "wrong" & gt; & Lt; Setter Property = "Foreground" Value = "# 99 99 99" /> & Lt; / Catalyst & gt; & Lt; /ControlTemplate.Triggers> & Lt; / ControlTemplate & gt; & Lt; /Setter.Value> & Lt; / Setter & gt; & Lt; / Style & gt;  

Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -