入门客AI创业平台(我带你入门,你带我飞行)
博文笔记

c# winform取全屏幕大小

创建时间:2012-10-25 投稿人: 浏览次数:2685

Winform,c#语句取(获取屏幕大小,包括全屏大小,除任务栏大小和全屏大小:

 

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

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

3.任务栏大小
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;

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

声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。
  • 上一篇:没有了
  • 下一篇:没有了
未上传头像