# Enable visual styles in WPF application



## MrSeanKon (Nov 30, 2012)

I also *find this* but it does not work too.
Source code is simple; it does not enable visual styles.
Am I wrong??


----------



## FordGT90Concept (Dec 1, 2012)

I think WPF is incompatible with Visual Styles.  Visual Styles is for WinForms.  WPF is an entirely different animal.


----------



## MrSeanKon (Dec 1, 2012)

*EUREKA!*

Steps:
1) I made a Windows form (HostWPF namespace, Form1 is the form).
2) I added a reference => System.Windows.Forms.Integration which contains classes that enable interoperation between the Windows Forms and WPF technologies. When you use System.Windows.Forms.Integration classes, you can host Windows Forms controls on WPF pages, and WPF elements in Windows Forms-based applications.
3) Then added a control (damn Vi$ual $tudio 2010 does not allow to add a WPF window) but after adding I edited the XMAL code in the way I want 
4) The next steps are simple. Download the first attachment. But => see the photo.
It crashes!!!!!
5) Finally???
We *must* use System.Windows.Forms.Application.Exit(); command because the WPF window *behaves* like a classical Windows Form.
Download the second attachment. Note that the Windows form's name is Initial.
Enjoy!


----------

