OnClosing事件怎么重写啊?新手 学习中
private void M_main_FormClosing(object sender, System.ComponentModel.CancelEventArgs e)
{
e.Cancel = true;
this.Hide();
this.ShowInTaskbar = false;
this.notifyIcon1.Visible = true; //窗体按close 最小化
//Application.Exit();
}
直接把我这段代码copy到你的程序代码作为一个方法就OK,
override就相当于已经把窗体的OnClosing事件重写,
而你需在关闭事件做的那些操作,就写在重写的方法体里面
在程序里 , 就是没有触发啊。
追答把FormClosing事件去掉再试试