怎么设置winform窗体自适应大小
------解决方案--------------------
一:修改 windowsState属性
二:取屏幕height 和 width值
------解决方案--------------------
this.AutoSize = true;
------解决方案--------------------
直接WindowState=Maximized
------解决方案--------------------
设置窗体的属性:
autoSizeMode设置为GrowAndShrink
autosize 设置为true
winForm的size单位就是分辨率,所以电脑换了新分辨率显示就会变形,你要不变形就必须设定新的size
Rectangle ScreenArea = System.Windows.Forms.Screen.GetWorkingArea(this);
int mywidth = ScreenArea.Width; //屏幕宽度
int myheight = ScreenArea.Height; //屏幕高度
new System.Drawing.Size(mywidth,myheight);//从绘窗体
Rectangle ScreenArea = System.Windows.Forms.Screen.GetWorkingArea(this);
int mywidth = ScreenArea.Width; //屏幕宽度
int myheight = ScreenArea.Height; //屏幕高度
new System.Drawing.Size(mywidth,myheight);//从绘窗体