2016-12-25 16 views
0

デュアルモニター(2台の1920x1080 = 3840x1080)にインストールするアプリケーションを開発しています。私の開発マシンは1440x900で、私は開発中にモニターを持っていません。 3840x1080(私の開発デスクトップ画面よりも大きい)サイズのウィンドウを作成する方法を理解することはできません。ウィンドウは1440x900まで単純に最大化されますが、これを超えることはありません。アプリケーションウィンドウをデスクトップ画面より大きく作成する

+2

'Width =" 3840 "Height =" 1080 "'? – Abion47

答えて

0
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; 
} 

これはうまくいきます。

関連する問題