I'm trying to write a program that opens a window on two screens. I want both windows on both monitors in full-screen.
So i used the win.forms function screen. All screens to do that. On the first screen everything is fine. but on the secondary screen the windows is not in full-screen.
So i wrote some code to show me the values of both monitors. I saw that the values of monitor 2 is not correct. Both monitors are on 192 x 1080.
but the second monitor is shown as 1536 x 864.
if (System.Windows.Forms.SystemInformation.MonitorCount < 2)
{
primaryScreen = System.Windows.Forms.Screen.PrimaryScreen;
}
else
{
if (screennumber == 2)
{
primaryScreen = System.Windows.Forms.Screen.AllScreens[1];
secondaryScreen = System.Windows.Forms.Screen.PrimaryScreen;
}
else
{
primaryScreen = System.Windows.Forms.Screen.PrimaryScreen;
secondaryScreen = System.Windows.Forms.Screen.AllScreens[0];
}
}
if (screennumber == 2)
{
ScreenTwo newWindow = new ScreenTwo();
newWindow.WindowStartupLocation = WindowStartupLocation.Manual;
newWindow.Left = m_PrimaryScreen.WorkingArea.Left;
newWindow.Top = m_PrimaryScreen.WorkingArea.Top;
newWindow.Width = m_PrimaryScreen.WorkingArea.Width;
newWindow.Height = m_PrimaryScreen.WorkingArea.Height;
newWindow.Show();
}
else
{
ScreenOne newWindow = new ScreenOne();
newWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
newWindowWindowStyle = WindowStyle.SingleBorderWindow;
newWindow.ShowInTaskbar = true;
newWindow.ResizeMode = ResizeMode.CanResizeWithGrip;
newWindow.WindowState = WindowState.Maximized;
newWindow.Show();
}
}
I did set the windowstate to maximize on window 2 but then window 2 opens on screen one. Anybody know how I can fix this???