1
2
3
4
5
6
7
8
9
10
11
12
13
Rectangle rect = new Rectangle();
rect = Screen.GetWorkingArea(this);

this.Width = rect.Width;//屏幕宽
this.Height = rect.Height;//屏幕高
this.ControlBox = false; // 设置不出现关闭按钮
this.FormBorderStyle = FormBorderStyle.None;//无边框

//名字空间"System.Windows.Forms"中的"Screen"类的GetWorkingArea()方法
//Rectangle rect = new Rectangle ( ) ;
//rect = Screen.GetWorkingArea ( this ) ;
//"屏幕宽"= rect.Width ;
//"屏幕长"= rect.Height ;

相关链接(侵删)

  1. winfrom 全屏自适应屏幕分辨率
  2. 怎样得到桌面的大小?

=================我是分割线=================

欢迎到公众号来唠嗑: