开发者

WPF Combobox rendering on XP

开发者 https://www.devze.com 2023-01-26 10:13 出处:网络
I have a problem with a simple combobox rendering on XP. The code is just: <ComboBox Cursor=\"Hand\" customCommands:ComboBoxSelectionChange.Command=\"{Binding StatusChange}\" It开发者_StackOverf

I have a problem with a simple combobox rendering on XP.

The code is just:

<ComboBox Cursor="Hand" customCommands:ComboBoxSelectionChange.Command="{Binding StatusChange}" It开发者_StackOverflow中文版emsSource="{Binding AvailabilityStatusList}"/>

However, the result on different OSs is not quite i've expected:

Vista:

WPF Combobox rendering on XP

XP:

WPF Combobox rendering on XP


You can force a WPF application to apply a certain Windows standard scheme, regardless of the current Windows Version (e.g. XP vs. Vista).

To force you application to use the Aero theme (Vista), put this in your App.xaml:

  <!-- Use the Aero scheme for your application, regardless the currently applied Windows Theme or OS Version. -->
    <ResourceDictionary
        Source="/PresentationFramework.Aero, Version=3.0.0.0, Culture=neutral, 
        PublicKeyToken=31bf3856ad364e35, ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml" />


The ComboBox -like most other controls- takes into account the OS theme, so that your user interface will be consistent with the rest of the OS surface.

If you want to create an "OS-agnostic" look (i.e. keep the same look across different operating systems) you have to re-template it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号