How do I get the native “look and feel” using WPF?

后端 未结 2 1619
Happy的楠姐
Happy的楠姐 2021-02-08 19:52

I\'ve just started developing a WPF application. This is not my first WPF app, but it will be the first that needs some polish. I know quite a bit about the \"plumbing\" of WPF

相关标签:
2条回答
  • 2021-02-08 20:15

    You should be able to put this into the application's OnLoad event to use the Vista theme, for example:

    Uri uri = new Uri("PresentationFramework.Aero;V3.0.0.0;31bf3856ad364e35;component\\themes/aero.normalcolor.xaml", UriKind.Relative); 
    
    Resources.MergedDictionaries.Add(Application.LoadComponent(uri) as ResourceDictionary);
    

    or for the Windows XP theme: themes/Royale.normalcolor.xaml

    0 讨论(0)
  • 2021-02-08 20:30

    You don't have to do anything - WPF does it for you.

    EDIT: It does. Run it with Aero/Luna and then Classic.

    0 讨论(0)
提交回复
热议问题