In a PC with multiple monitors, say you run your application which have have a second Window/Dialog other than the main window (such as Options) that you want it to open in the same screen/monitor as your MainWindow
. How to force this behavior?
You basically want to stop the scenario that your MainWindow
is on one monitor and when you bring up the "Options" page, it shows on a different screen/monitor.
1] Move apps to the desired monitor To do so, open the app on your computer first. Then, drag or move it to the desired monitor you want to open it on. Following that, close the app by clicking the Close or red cross button. After that, it will open on the last opened monitor all the time.
Action Center in Windows 10 is where you'll find your notifications and quick actions. Change your settings at any time to adjust how and when you see notifications and which apps and settings are your top quick actions. Select Start . Select Settings > System > Notifications & actions.
Click Start, point to Programs, click Control Panel, and then double- click Display. Click the Settings tab. In the Display box, click the secondary display adapter. Click the "Extend my Windows desktop onto this monitor" check box to clear it, and then click OK.
Have you looked at the WindowStartupLocation
property for Window
?
CenterScreen
places the Window in the center of the screen containing the cursor, which should normally be fine. For example, if a user clicks a button on your Window and a dialog opens, the cursor will still be over the button and thus the dialog will show up in the center of the same Window.
CenterOwner
places the Dialog in the center of the Window specified as it's owner. Declare the new Window similar to this:
MyDialog d = new MyDialog { Owner = parentWindow };
d.ShowDialog();
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