加入收藏 | 设为首页 | 会员中心 | 我要投稿 北几岛 (https://www.beijidao.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

C# 获取屏幕的大小

发布时间:2021-05-20 14:35:06 所属栏目:大数据 来源: https://blog.csdn.net/kasama1
导读:WinForm : int ?iActulaWidth =? Screen .PrimaryScreen.Bounds.Width; int ?iActulaHeight =? Screen .PrimaryScreen.Bounds.Height ; ? System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width??? ?? System.Windows.Forms.Screen.PrimaryScreen.Bounds

WinForm

int?iActulaWidth =?Screen.PrimaryScreen.Bounds.Width;

int?iActulaHeight =?Screen.PrimaryScreen.Bounds.Height ;

? System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width??? ?? System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height
Screen.PrimaryScreen.WorkingArea.Height; Screen.PrimaryScreen.WorkingArea.Width;


?

WPF下的:

double?dWidth = System.Windows.SystemParameters.PrimaryScreenWidth;

double?dHeight = System.Windows.SystemParameters.PrimaryScreenHeight;

double?dWidth2 = ActualWidth;?//获取此元素的呈现宽度。若此元素时全屏的,则可以获得屏幕大小(-_-!!!)

double?dHeight2 = ActualHeight;?//获取此元素的呈现高度。

(编辑:北几岛)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读