当前位置:首页 > 开发 > 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://pythonopen.com/?id=244

返回列表

上一篇:C# 颜色算法

下一篇:C# 捕获鼠标

相关文章

C# MDI例子

父窗口属性IsMdiContainer设置为Trueprivate void b...

C# double转为string并保留两位小数

在 C# 中,可以使用多种方式将 double 类型的数据转换为 string 类型并保留两位小数,...

C# 类接口

定义接口是一种抽象类型,它定义了一组方法签名(方法名称、参数列表和返回类型),但没有方法体。接口用于...

C# using与多重using

1. using 语句概述在 C# 中,using 语句主要用于确保实现了 IDisposable...

C# TextRenderer.MeasureText

TextRenderer.MeasureText是System.Windows.Forms命名空间中...