This brief article explains how you can achieve this.
If you find yourself in need to open a WPF Window from a WinForms program, this is one way to do it (works for me):
- Create/Add a new project of type
WPF Custom Control Library
- Add a new Item of type
Window (WPF)
- Do your thing with the WPF Window
-
From your WinForms app, create and open the WPF Window
using System; using System.Windows.Forms; using System.Windows.Forms.Integration; var wpfwindow = new WPFWindow.Window1(); ElementHost.EnableModelessKeyboardInterop(wpfwindow); wpfwindow.Show();