How to enable visual styles in WPF for general dialogs?

When using the wpf elements of my application, all the styles are for the operating system, but when I use OpenDialog or MessageBox, it displays the old way of Windows 9X. Is there an easier way to make an equivalent call to Application.EnableVisualStyles () so that the windows and message dialogs look the same as other applications?

+6
c # styles wpf dialog
source share
3 answers
+5
source share

You need to add the manifest to your assembly. You can do this using Add New Item -> General -> Application Manifest File.

Then add the following to the asmv1 tag in the manifest file:

<dependency> <dependentAssembly> <assemblyIdentity name="Microsoft.Windows.Common-Controls" version="6.0.0.0" type="win32" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" /> </dependentAssembly> </dependency> 
+18
source share

Im my case in the used Winforms elements inside WPF then applied EnableVisualStyles () ...

0
source share

All Articles