如题
  如何得到 是点击 X 关闭 winform 的?

解决方案 »

  1.   

    winform 的 closing 事件  可以 用 e.Canlcle=true 取消关闭
      

  2.   

    protected override void WndProc(ref System.Windows.Forms.Message m) 

    if(m.Msg==0x0010)
    {
    MessageBox.Show("你是点击 X 关闭 winform 的!");
    //return; //返回空点击关闭无效
    }
    base.WndProc(ref m);
    }
      

  3.   

    如果我是 this.Close() 一样能执行到 你这个方法