把窗口的关闭按钮的功能改为最小化 我在写一个winform程序,希望按下关闭按钮只是将窗口最小化,或者将窗口隐藏了,并不是真的执行关闭。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 C#下没用过.在C++下可以拦截这个关系的Message来执行其他的代码的.我想C#下也应该可以这样来做的吧?? 参看http://www.syncfusion.com/faq/windowsforms/Search/862.aspx 在onclosing里,先让e.cancel = true;然后再发送最小化命令 public const int SC_CLOSE = 0xF060; public const int WM_SYSCOMMAND = 0x0112; //_closeClick is a bool member of the form initially set false... // It can be tested in the Closing event to see how the closing came about. protected override void WndProc(ref System.Windows.Forms.Message m) { if(m.Msg == WM_SYSCOMMAND && (int)m.WParam == SC_CLOSE) this._closeClick = true; base.WndProc(ref m); } 关于控件失去焦点同时另一个控件得到焦点问题 求教关于字段类型的可访问性不能比字段本身的可访问性低的问题 InstallShield 2009 设置和获取ComboBox的值 脚本语言 如何实现gridView的datasource累加功能? 安装包问题 在线等 xml和数据库... 我想问一下在C#中如何画网络拓扑图! 日期转换格式 高手进来看看 帮忙看看 我修改LayoutControl上的值时 TextChanged事件不触发呢? 总是提示"必须声明变量@pp",请帮忙. 在datagrid控件的单元格中显示多行文字
http://www.syncfusion.com/faq/windowsforms/Search/862.aspx
先让e.cancel = true;
然后再发送最小化命令
public const int WM_SYSCOMMAND = 0x0112;
//_closeClick is a bool member of the form initially set false...
// It can be tested in the Closing event to see how the closing came about.
protected override void WndProc(ref System.Windows.Forms.Message m)
{
if(m.Msg == WM_SYSCOMMAND && (int)m.WParam == SC_CLOSE)
this._closeClick = true;
base.WndProc(ref m);
}