Create application window larger than desktop screen

179 views Asked by At

I am developing an application that will be installed on a dual monitor (two 1920x1080 = 3840x1080). My developing machine is 1440x900, and I do not have the monitors during development. I cannot figure how to create a window sized 3840x1080 (larger than my development desktop screen), and the window simply maximized to 1440x900 but not beyond.

1

There are 1 answers

0
Sourabh Mishra On
    One of the way in which you can do this this to analyze the form screen size.
    This is the working example:

        if (System.Windows.Forms.Screen.AllScreens.Length == 2 &&
                        System.Windows.Forms.Screen.AllScreens[0].WorkingArea.Width == System.Windows.Forms.Screen.AllScreens[1].WorkingArea.Width) {
                    // dual-display logic
                    System.Drawing.Rectangle sl = System.Windows.Forms.Screen.AllScreens[0].WorkingArea;
                    System.Drawing.Rectangle sr = System.Windows.Forms.Screen.AllScreens[1].WorkingArea;
                    Application.Current.MainWindow.Left = sl.Left;
                    Application.Current.MainWindow.Top = sl.Top;
                    Application.Current.MainWindow.Width = sr.Width + sl.Width;
                    Application.Current.MainWindow.Height = sl.Height;
} else {
                // single-display logic
                System.Drawing.Rectangle s = System.Windows.Forms.Screen.AllScreens[0].WorkingArea;
                Application.Current.MainWindow.Left = s.Left; Application.Current.MainWindow.Top = s.Top; Application.Current.MainWindow.Width = (s.Width / 2); Application.Current.MainWindow.Height = s.Height;
}

Hope this will work for you.