首页 > Windows开发 > 详细

winform,wpf,winrt获取屏幕分辨率

时间:2014-08-08 15:42:26      阅读:904      评论:0      收藏:0      [点我收藏+]

winform

当前的屏幕除任务栏外的工作域大小
    this.Width = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width;
    this.Height = System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height;

当前的屏幕包括任务栏的工作域大小
this.Width=System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
this.Height=System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;

任务栏大小
this.Width=System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width-System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width;
this.Height=System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height-System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height;

winform实现全屏显示
WinForm:
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.TopMost = true;  

wpf

double width= SystemParameters.PrimaryScreenWidth;

double height = SystemParameters.PrimaryScreenHeight;

winrt

double width = CoreWindow.GetForCurrentThread().Bounds.Width;

double height = CoreWindow.GetForCurrentThread().Bounds.height;

官方的回复:http://social.msdn.microsoft.com/Forums/zh-CN/a376a37b-f7d6-4d05-aa8e-75768e2f12b7/win8?forum=winstoreappzhcn

winform,wpf,winrt获取屏幕分辨率,布布扣,bubuko.com

winform,wpf,winrt获取屏幕分辨率

原文:http://www.cnblogs.com/wangjinming/p/3899295.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!