关于C#中实现点击窗体的关闭按钮时弹出确认对话框的问题

2025-03-27 13:57:59
推荐回答(1个)
回答1:

你是不是没有生成对应的事件。
看看窗体的属性窗口的事件中的FormClosing中有没有Form1_FormClosing
或者Form1.Designer.cs
中有没有
this.FormClosing
+=
new
System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);