protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (Screen.AllScreens.Length > 1) { Form2 frm = new Form2(); // Important ! frm.StartPosition = FormStartPosition.Manual; // Get the second monitor screen Screen screen = GetSecondaryScreen(); // set the location to the top left of the second screen frm.Location = screen.WorkingArea.Location; // set it fullscreen frm.Size = new Size(screen.WorkingArea.Width, screen.WorkingArea.Height); // Show the form frm.Show(); } }
public Screen GetSecondaryScreen() { if (Screen.AllScreens.Length == 1) { return null; } foreach (Screen screen in Screen.AllScreens) { if (screen.Primary == false) { return screen; } } return null; }
null
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)