.net 在 C# 中以 Windows 形式获取屏幕大小(以像素为单位)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12816860/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 16:39:11  来源:igfitidea点击:

Get screen size in pixels in windows form in C#

.netwinformsc#-4.0

提问by Anshuman Jasrotia

Possible Duplicate:
How to retrieve the Screen Resolution from a C# winform app?

可能的重复:
如何从 C# winform 应用程序中检索屏幕分辨率?

How can I get the screen size in Windows forms?

如何在 Windows 窗体中获取屏幕大小?

回答by Steve

Check the Screenclass and its property Bounds

检查Screen类及其属性 Bounds

Screen.PrimaryScreen.Bounds.Width;
Screen.PrimaryScreen.Bounds.Height;
Screen.PrimaryScreen.Bounds.Size;