窗体右上角差号关闭按钮无效化privatevoidForm1_FormClosing(objectsender,FormClosingEventArgse){e.Cancel=true;//取消该事件}