Going fullscreen on secondary monitor

Extension method to Maximize a window to the secondary monitor (if there is one). Doesn’t assume that the secondary monitor is System.Windows.Forms.Screen.AllScreens[2]; using System.Linq; using System.Windows; namespace ExtendedControls { static public class WindowExt { // NB : Best to call this function from the windows Loaded event or after showing the window // (otherwise window … Read more

window.open() on a multi-monitor/dual-monitor system – where does window pop up?

Result of “window.open dual-screen” search revealed this fancy nugget: Dual Monitors and Window.open “When the user clicks on a link that opens a new window using window.open. Make the window appear on the same monitor as its’ parent.” // Find Left Boundry of the Screen/Monitor function FindLeftScreenBoundry() { // Check if the window is off … Read more

How do I ensure a form displays on the “additional” monitor in a dual monitor scenario? [duplicate]

You need to use the Screen class to find a screen that the original form is not on, then set the second form’s Location property based on that screen’s Bounds. For example: var myScreen = Screen.FromControl(originalForm); var otherScreen = Screen.AllScreens.FirstOrDefault(s => !s.Equals(myScreen)) ?? myScreen; otherForm.Left = otherScreen.WorkingArea.Left + 120; otherForm.Top = otherScreen.WorkingArea.Top + 120; This … Read more

Show JFrame in a specific screen in dual monitor configuration

public static void showOnScreen( int screen, JFrame frame ) { GraphicsEnvironment ge = GraphicsEnvironment .getLocalGraphicsEnvironment(); GraphicsDevice[] gs = ge.getScreenDevices(); if( screen > -1 && screen < gs.length ) { gs[screen].setFullScreenWindow( frame ); } else if( gs.length > 0 ) { gs[0].setFullScreenWindow( frame ); } else { throw new RuntimeException( “No Screens Found” ); } }