在窗口的resize事件中写代码
private void Form_Order_Content_Resize(object sender, EventArgs e) { //还原窗口时居中显示 int screenTop = (System.Windows.Forms.Screen.GetWorkingArea(this).Width-this.Width)/2; int screenLeft = (System.Windows.Forms.Screen.GetWorkingArea(this).Height-this.Height)/2; if (this.WindowState == FormWindowState.Normal) { this.Location = new Point(screenTop, screenLeft); } }