I'm trying to create a wpf video player with media element. My goal is making muliple windows for that application. each of the windows will show up on different monitors. Like the MainWindow will get the resolution of primary monitor and resize itself to go full screen. The Second window on secondary monitor and so...
So far, I've made the MainWindow fullscreen on the primary monitor. but I've no idea how to show the second window on second monitor with it's resolution. please help.
Easiest option is to display it. And after the show() method, resize it.
// display on second window
NewWindow win = new NewWindow();
System.Windows.Forms.Screen s1 = System.Windows.Forms.Screen.AllScreens[2];
System.Drawing.Rectangle r1 = s1.WorkingArea;
win.WindowState = System.Windows.WindowState.Normal;
win.WindowStartupLocation = System.Windows.WindowStartupLocation.Manual;
win.Top = r1.Top;
win.Left = r1.Left;
win.Show();
win.WindowState = System.Windows.WindowState.Maximized;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With