当前位置:首页 > 开发 > C# > 正文内容

C# 获取屏幕高宽度

C#3年前 (2022-11-03)
方式1-不包含任务栏高度    
var primaryScreenHeight = SystemParameters.FullPrimaryScreenHeight;
var primaryScreenWidth = SystemParameters.FullPrimaryScreenWidth;


方式2-需要Forms    
var w = Screen.GetBounds(this).Width;
var h = Screen.GetBounds(this).Height;



转载请注明出处。

本文链接:http://www.pythonopen.com/?id=244

返回列表

上一篇:C# 颜色算法

下一篇:C# 捕获鼠标

相关文章

C# XML

创建    XmlDocument xmlDoc ...

C# 可空参数

using System; using System.Runtime.Inte...

C# System.IO.Path

System.IO.Path.GetExtension返回指定的路径字符串的扩展名。string&n...

C# ref 和out

ref关键字概念:ref是 C# 中的一个关键字,用于按引用传递参数。当在方法调用中使用ref关键字...

C# Byte[]转为Bitmap

在 C# 中,可以使用System.Drawing命名空间下的相关类将byte[]类型的数据转换为B...

C# i++和++i的区别

核心区别操作顺序            ...