• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.
  • The forums have been upgraded with support for dark mode. By default it will follow the setting on your system/browser. You may override it by scrolling to the end of the page and clicking the gears icon.

Enable visual styles in WPF application

MrSeanKon

New Member
Joined
Nov 14, 2006
Messages
267 (0.04/day)
Location
Athens in love with Anna :)
I also find this but it does not work too.
Source code is simple; it does not enable visual styles.
Am I wrong?? :rolleyes: :rolleyes:
 

Attachments

Last edited:
I think WPF is incompatible with Visual Styles. Visual Styles is for WinForms. WPF is an entirely different animal.
 
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!
 

Attachments

Last edited:
Back
Top