1

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: Combobox Vista
XP: Combobox XP

sagibb
  • 956
  • 2
  • 9
  • 21

2 Answers2

3

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" />
olli-MSFT
  • 2,556
  • 19
  • 19
  • Thanks, this is exactly what I was looking for! Since our application does not use the OS color scheme (It uses customized, transparent windows), it will not appear as weird even on customized themes. The only issue that is still there is a difference between the font size on XP and Vista/7. – sagibb Nov 28 '10 at 14:36
  • Wow!! Did not know you could do this. Very impressed. – Eddie Nov 30 '11 at 14:25
1

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.

Francesco De Vittori
  • 9,100
  • 6
  • 33
  • 43
  • I don't really want (or need) to re-template it, i just want it to look decent. You can clearly see in the screenshot that the standard result on XP is distorted. – sagibb Nov 24 '10 at 15:17
  • It is not distorted. It's just that you have to set its height. Try Height="20" and it will magically look like you want. – Francesco De Vittori Nov 24 '10 at 16:06