When using the wpf elements of my application, everything styles to the operating system, but when I use an OpenDialog or a MessageBox, it renders the older Windows 9X way. Is there an easier way I can do an Application.EnableVisualStyles() equivalent call to make the message boxes and dialogs look the same as the rest of the application?
You need to add a manifest to your assembly. You can do this via Add New Item-->General-->Application Manifest file.
Then add the following somewhere inside 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>
This blog post may be worth a look:
Why does the OpenFileDialog in WPF look so “1999” and how can I fix it?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With