【问题标题】:Windows 8 Metro button color changed on rollover翻转时 Windows 8 Metro 按钮颜色更改
【发布时间】:2012-11-26 10:28:00
【问题描述】:

我正在构建一个 Metro 应用程序。我已将背景颜色设置为黑色,将前景设置为白色。当我构建、测试和翻转按钮时,它的颜色变为白色。这不适用于我的配色方案。

如何防止按钮在鼠标悬停时改变颜色?

谢谢

【问题讨论】:

  • 运气好。必须为按钮添加新样式。

标签: windows-8 microsoft-metro


【解决方案1】:

您弄清楚了需要为单个按钮(或应用中的按钮子集)执行哪些操作。但是,如果您想为应用中的所有按钮执行此操作,则可以在 app.xaml 中覆盖:

    <ResourceDictionary.ThemeDictionaries>
        <!-- When not in high contrast mode, use a colorful look. 
                                Note that this is defining an implicit style that is scoped to this StackPanel. -->

        <ResourceDictionary x:Key="Default">
            <Thickness x:Key="ButtonBorderThemeThickness">2</Thickness>
            <SolidColorBrush x:Key="ButtonForegroundThemeBrush" Color="#FFFFFFFF" />
            <SolidColorBrush x:Key="ButtonBackgroundThemeBrush" Color="#FF0088B4" />
            <SolidColorBrush x:Key="ButtonPointerOverForegroundThemeBrush" Color="#FF0088B4" />
            <SolidColorBrush x:Key="ButtonPointerOverBackgroundThemeBrush" Color="#FF7ED1EC" />
            <SolidColorBrush x:Key="ButtonPressedForegroundThemeBrush" Color="#FF0088B4" />
            <SolidColorBrush x:Key="ButtonPressedBackgroundThemeBrush" Color="#FFFFFFFF" />
            <SolidColorBrush x:Key="ButtonBorderThemeBrush" Color="#FF0088B4" />
            </ResourceDictionary>
        </ResourceDictionary.ThemeDictionaries>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多