Alex Rivera | Logout

Showing a window with WPF, Winforms, and Dual monitors

Asked 2009-02-04T17:23:50.567
13

I have a 2 monitors and a WinForm app that launches a WPF window. I want to get the screen that the WinForm is on, and show the WPF window on the same screen. How can I do this?

Edit
Report

1 Answer

3

Another way of doing it is:

WindowInteropHelper helper = new WindowInteropHelper(this);

this.StartupLocation = System.Windows.WindowStartupLocation.Manual;
this.Left = System.Windows.Forms.Screen.FromHandle(helper.Handle).Bounds.Left;
this.Top = System.Windows.Forms.Screen.FromHandle(helper.Handle).Bounds.Top;

this = your WPF Window...

answered 2012-08-29T03:46:48.447

Your Answer