可能重複:
How to retrieve the Screen Resolution from a C# winform app?得到像素的屏幕尺寸在windows窗體在C#
我怎樣才能在Windows窗體的屏幕尺寸?
可能重複:
How to retrieve the Screen Resolution from a C# winform app?得到像素的屏幕尺寸在windows窗體在C#
我怎樣才能在Windows窗體的屏幕尺寸?
檢查Screen類和它的屬性Bounds
Screen.PrimaryScreen.Bounds.Width;
Screen.PrimaryScreen.Bounds.Height;
Screen.PrimaryScreen.Bounds.Size;
小心:在MULTIPLE MONITOR系統,您可能想要知道的是特定窗體所在屏幕的大小。爲此,使用Screen.FromControl(myForm)。有關更多詳細信息,請參閱http://stackoverflow.com/questions/2402739/how-to-retrieve-the-screen-resolution-from-a-c-sharp-winform-app。 – ToolmakerSteve
適用於多屏幕系統。人們可以從應用程序的主窗體獲得主窗體最大部分的屏幕,例如: Screen.FromControl(this).WorkingArea; – gg89
在這裏看到:http://stackoverflow.com/questions/2402739/how-to-retrieve-the-screen-resolution-from-ac-sharp -winform-app –
[This has both](http://stackoverflow.com/questions/254197/how-can-i-get-the-active-screen-dimensions)WinForms和WPF解決方案 –