当前位置:首页 > 开发 > 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# 获取程序运行路径

AppDomain.CurrentDomain.BaseDirectory...

C# BackgroundWorker的例子

以下是一个使用 BackgroundWorker 组件在 C# 中实现后台执行任务,同时在主线程更新...

c# Invalidate、Refresh、Refreshitem、Refreshitems的功能

Invalidate方法功能概述Invalidate方法主要用于使控件的特定区域(整个控件或部分区域...

C# MemoryStream转为Image

        //...

C# Control防闪烁

SetStyle(ControlStyles.AllPaintingInWmPaint |...

C# Graphics图像抗锯齿

g.SmoothingMode = SmoothingMode.AntiAlia...