• We've upgraded our forums. Please post any issues/requests in this thread.

Enable visual styles in WPF application

FordGT90Concept

"I go fast!1!11!1!"
Joined
Oct 13, 2008
Messages
20,907 (6.24/day)
Likes
10,003
Location
IA, USA
System Name BY-2015
Processor Intel Core i7-6700K (4 x 4.00 GHz) w/ HT and Turbo on
Motherboard MSI Z170A GAMING M7
Cooling Scythe Kotetsu
Memory 2 x Kingston HyperX DDR4-2133 8 GiB
Video Card(s) PowerColor PCS+ 390 8 GiB DVI + HDMI
Storage Crucial MX300 275 GB, Seagate 6 TB 7200 RPM
Display(s) Samsung SyncMaster T240 24" LCD (1920x1200 HDMI) + Samsung SyncMaster 906BW 19" LCD (1440x900 DVI)
Case Coolermaster HAF 932 w/ USB 3.0 5.25" bay
Audio Device(s) Realtek Onboard, Micca OriGen+
Power Supply Enermax Platimax 850w
Mouse SteelSeries Sensei RAW
Keyboard Tesoro Excalibur
Software Windows 10 Pro 64-bit
Benchmark Scores Faster than the tortoise; slower than the hare.
#2
I think WPF is incompatible with Visual Styles. Visual Styles is for WinForms. WPF is an entirely different animal.
 

MrSeanKon

New Member
Joined
Nov 14, 2006
Messages
267 (0.07/day)
Likes
73
Location
Athens in love with Anna :)
#3
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: