码迷,mamicode.com
首页 > Windows程序 > 详细

C#WinForm获取屏幕大小

时间:2015-08-11 17:44:45      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:

 

当前的屏幕除任务栏外的工作域大小
    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;   

winform获取屏幕区域
Rectangle ScreenArea = System.Windows.Forms.Screen.GetWorkingArea(this);

 

C#WinForm获取屏幕大小

标签:

原文地址:http://www.cnblogs.com/shenchao/p/4721491.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!