Different color on Win7 and Win10

Docking/MDI for WPF Forum

Posted 7 years ago by Emir Dizdarevic
Version: 17.2.0661
Avatar

I have a issue regarding setting my own theme on windows 7, it works as desired on Win10. Resource code looks like this: 

 

<SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarBackgroundActiveBrushKey}" Color="{DynamicResource TabBackgroundColor}" />
  
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarBackgroundInactiveBrushKey}" Color="{DynamicResource TabBackgroundColor}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarInnerBorderActiveBrushKey}" Color="{DynamicResource TabBackgroundColor}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarForegroundInactiveBrushKey}" Color="{DynamicResource TabBackgroundColor}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowBorderActiveBrushKey}" Color="{DynamicResource TabBackgroundColor}" />
    <CornerRadius x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonBorderNormalCornerRadiusKey}">3,3,3,3</CornerRadius>
    <CornerRadius x:Key="{x:Static themes:AssetResourceKeys.WindowControlBorderNormalCornerRadiusKey}">3,3,3,3</CornerRadius>
   
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateBorderActivePressedBrushKey}" Color="{DynamicResource Col-118}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateBorderInactiveDisabledBrushKey}" Color="{DynamicResource Col-118}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateBorderActiveNormalBrushKey}" Color="{DynamicResource Col-96}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateBorderInactiveNormalBrushKey}" Color="{DynamicResource Col-96}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateBorderActiveDisabledBrushKey}" Color="{DynamicResource Col-96}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateBorderActiveHoverBrushKey}" Color="{DynamicResource Col-142}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonHighlightActivePressedBrushKey}" Color="{DynamicResource TabBackgroundColor}" />

    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonForegroundActivePressedBrushKey}" Color="{DynamicResource Col-142}" />
    
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonBorderInactiveNormalBrushKey}" Color="{DynamicResource Col-96}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonBorderActiveHoverBrushKey}" Color="{DynamicResource Col-142}" />
    <!--maximize knappen når man hoverer over-->
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonBorderActiveNormalBrushKey}" Color="{DynamicResource Col-96}" />
   
    <!--maximize knappenb border farge-->
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateInnerBorderActiveNormalBrushKey}" Color="{DynamicResource Col-96}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateInnerBorderActiveHoverBrushKey}" Color="{DynamicResource Col-142}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateInnerBorderActiveDisabledBrushKey}" Color="{DynamicResource Col-96}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateInnerBorderInactiveDisabledBrushKey}" Color="{DynamicResource Col-96}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateInnerBorderInactiveNormalBrushKey}" Color="{DynamicResource Col-96}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateInnerBorderActivePressedBrushKey}" Color="{DynamicResource Col-118}" />
    


    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonBackgroundActivePressedBrushKey}" Color="{DynamicResource Col-118}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonBackgroundActiveHoverBrushKey}" Color="{DynamicResource TabBackgroundColor}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateHighlightActiveHoverBrushKey}" Color="{DynamicResource TabBackgroundColor}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonHighlightActiveHoverBrushKey}" Color="{DynamicResource TabBackgroundColor}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonForegroundActiveHoverBrushKey}" Color="{DynamicResource Col-255}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateBackgroundActiveHoverBrushKey}" Color="{DynamicResource TabBackgroundColor}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateBackgroundActiveDisabledBrushKey}" Color="{DynamicResource TabBackgroundColor}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateBackgroundActivePressedBrushKey}" Color="{DynamicResource TabBackgroundColor}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateBackgroundInactiveDisabledBrushKey}" Color="{DynamicResource TabBackgroundColor}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateForegroundActiveDisabledBrushKey}" Color="{DynamicResource TabBackgroundColor}" />
    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonAlternateForegroundActiveHoverBrushKey}" Color="{DynamicResource Col-255}" />

    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonInnerBorderActivePressedBrushKey}" Color="{DynamicResource Col-118}" />

    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarButtonBorderActivePressedBrushKey}" Color="{DynamicResource Col-118}" />

    <SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.WindowTitleBarInnerBorderInactiveBrushKey}" Color="{DynamicResource TabBackgroundColor}" />

 But for some reasons, the maximize and close button on windows 7 don't get the right colors, the rest of the titlebar get's correct colors.. any suggestions? 

Comments (5)

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

Hi Emir,

Did you set the ThemeManager.CurrentTheme property to "MetroLight" in the app startup before UI loads?


Actipro Software Support

Posted 7 years ago by Emir Dizdarevic
Avatar

Hmmm I have set this to metroLightColor: 

 

    <system:String x:Key="{x:Static themes:AssetResourceKeys.ThemeNameStringKey}">MetroLightColor</system:String>

 Do I have to use the themeManager?

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

Yes try setting what I suggested in your app startup.  You can read through the Themes' Getting Started topic in the documentation that comes with the product.  That has a "Setting an Application-Wide Theme" section in it.


Actipro Software Support

Posted 7 years ago by Emir Dizdarevic
Avatar

Hello 

I tried setting ThemeManager.CurrentTheme = ThemeName.MetroLight.ToString(); but still got the wrong result.

It seems like win7 gets the theme 90% correct, titlebar has my theme, but the buttons are stil windows theme, except when you hover over them, then the button has my theme. But this happens without sette currentTheme. 

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

Hi Emir,

I tried running our main sample app on Windows 7 with Metro Light theme and the title bar buttons showed up ok.  Are you seeing the same in our main sample app without any changes, or do you see the problem there too?  If you aren't seeing them there, please make a new simple sample project showing the issue and email that to our support address, referencing this thread.  Make sure you exclude any bin/obj folders and rename the .zip file extension so it doesn't get spam blocked.  Thanks!


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.