实现效果:
知识运用:
窗体的WindowState属性 和FormBorderStyle属性
实现代码:
private void Form1_MouseDoubleClick(object sender, MouseEventArgs e) { bool Validate=(this.WindowState==FormWindowState.Maximized); if(Validate){ this.FormBorderStyle = FormBorderStyle.Sizable; this.WindowState = FormWindowState.Normal; }else{ this.FormBorderStyle = FormBorderStyle.None; this.WindowState = FormWindowState.Maximized; } }