自动适应屏幕大小而自动调整窗体内控件的位置大小设置dock属性或anchor属性
以dataGrid1为例
this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Fill;

this.dataGrid1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
| System.Windows.Forms.AnchorStyles.Left) 
| System.Windows.Forms.AnchorStyles.Right)));
你也可在设计器里直接设置