WPF在XP上的Combobox渲染 [英] WPF Combobox rendering on XP

查看:114
本文介绍了WPF在XP上的Combobox渲染的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的组合框渲染在XP上的问题。



代码只是:

 < ComboBox Cursor = HandcustomCommands:ComboBoxSelectionChange.Command ={Binding StatusChange}ItemsSource ={Binding AvailabilityStatusList}/>但是,在不同的操作系统上的结果是不是我期待的:


$ b


$ b

Vista:

XP:

解决方案

您可以强制WPF应用程序应用某个Windows标准方案,而不考虑当前的Windows版本(例如XP与Vista)。



强制您使用应用程序Aero主题(Vista),将其放在您的App.xaml中:

 应用程序,无论当前应用的Windows主题或操作系统版本。 - > 
< ResourceDictionary
Source =/ PresentationFramework.Aero,Version = 3.0.0.0,Culture = neutral,
PublicKeyToken = 31bf3856ad364e35,ProcessorArchitecture = MSIL; component / themes / aero.normalcolor.xaml />


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

The code is just:

<ComboBox Cursor="Hand" customCommands:ComboBoxSelectionChange.Command="{Binding StatusChange}" ItemsSource="{Binding AvailabilityStatusList}"/>

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

Vista:
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" />

这篇关于WPF在XP上的Combobox渲染的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆