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

C# 获取屏幕高宽度

C#4年前 (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# 捕获鼠标

相关文章

ListView RetrieveVirtualListItem 事件需要每个 ListView 列的列表视图子项。”

System.InvalidOperationException:“处于 VirtualMode 中...

C# 获取文件图标

string file = @"C:\Windows\exp...

C# XML

创建    XmlDocument xmlDoc ...

在 C# 中实现类似于 Windows 资源管理器的“名称”排序方式

要在 C# 中实现类似于 Windows 资源管理器的“名称”排序方式,你需要考虑以下几点:1. 不...

C# BackgroundWorker,在DoWork里更新控件内容

一般情况下不可以直接在BackgroundWorker的DoWork事件中更新 UI 控件在Back...

C# Byte[]转为Bitmap

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