C#根据屏幕大小设置窗体

//根据屏幕大小设置窗体初始大小 
//Rectangle rect = System.Windows.Forms.SystemInformation.VirtualScreen; 
Rectangle rect = SystemInformation.WorkingArea; 
this.Height = rect.Height; 
this.Width = rect.Width; 
//根据屏幕大小设置窗体最大化大小 
this.MaximizedBounds = new Rectangle(rect.X, rect.Y, rect.Width - 2, rect.Height - 2);

 

posted @ 2017-11-23 15:38  ParanoiaApe  阅读(471)  评论(0编辑  收藏  举报