When I press F5 to debug my C# Windows form app, built with Visual Studio 2017 pro on Windows 10, the app window always displays on my main monitor, which is the middle monitor of my 3 monitors.
Is there a 'trick' to always open and display on the left-hand monitor? (I want to use middle monitor to see the source code.)
If no trick, then I must program form's x,y to persist across debug sessions.
Try setting the form's startup location manually.
this.StartPosition = FormStartPosition.Manual;
Then you should be able to find your other monitor and apply its' location to your current form using
Screen[] screens = Screen.AllScreens;
Point location = screens[0].Bounds.Location;
this.Left = location.X;
this.Top = location.Y;
I can't confirm that this is exactly what you need since I currently am not at a computer with multiple monitors but it should be something very close to this if I'm wrong.
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