Why do WPF Applications look different between Windows 7 and Windows 8 and can this be fixed?

前端 未结 4 462
無奈伤痛
無奈伤痛 2021-01-31 10:13

I\'m really surprised that this question does not appear to have been asked yet... if it has, but I just couldn\'t find it, apologies.

Ok, so my work computer has just b

4条回答
  •  心在旅途
    2021-01-31 11:07

    Ok, so unfortunately, there was no quick fix for this problem. If you are in a similar situation and the answers supplied here do not work for you either, then here is a summary of the changes that I manually needed to make in order to make the UI on Windows 8 appear the same as the UI on Windows 7.

    TextBox: Needed to add Padding to default Style:

    
    

    ListBoxItem: Needed to provide new ControlTemplate to hide selection and mouse over background colours:

    
    

    ComboBoxItem: Needed to provide new ControlTemplate to change selection and mouse over background colours:

    
    

    CheckBox: Needed to provide new ControlTemplate to stop tick from appearing back to front when Bullet is to the right of the Content (thanks to Fredrik's answer to the Default ControlTemplate for CheckBox question here on Stack Overflow:

    
    
    
    
    
    

    To remove the horrendous title bar and display the default Windows 8 one: Needed to upgrade to .NET 4.5 and utilise the included System.Windows.Controls.Ribbon namespace library instead of the separate 'Microsoft Ribbon for WPF' (RibbonControlsLibrary) dll previously used.

    Unfortunately, I never found out how to reproduce the SemiBold setting of the FontWeight property on Windows 8. If anyone knows how to do this, please let me know.

    On the whole, the move to Windows 8 has been a painful and troubling experience. I hope this information will help others in a slightly less painful manner.

提交回复
热议问题