//根据屏幕大小设置窗体初始大小
//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);
C#根据屏幕大小设置窗体
原创
©著作权归作者所有:来自51CTO博客作者zhangxinglong12的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
C#如何设置窗体不能修改大小
找到FormBorderStyle设置为FixedDialog即可
FixedDialog -
C#窗体应用设置多窗体和设置启动窗体
场景VS中使用C#开发一个登录窗体应用程序:https://
多窗体 Windows 应用程序 资源管理器 -
C#中winform窗体常用设置
使用.Net编写Windows程序,对于窗体控制常见项目1、让窗体在启动时在指定位置出现
控件 最小化 c# 任务栏 背景图片