隐藏窗体,而不是结束时关闭按钮点击 [英] Hide form instead of closing when close button clicked
本文介绍了隐藏窗体,而不是结束时关闭按钮点击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当用户单击窗体上的<大骨节病> X 骨节病>按钮,我怎么能隐藏关闭它而?
When a user clicks the X button on a form, how can I hide it instead of closing it?
我已经试过 this.hide()
在的FormClosing
,但它仍然关闭窗体。
I have tried this.hide()
in FormClosing
but it still closes the form.
推荐答案
像这样:
private void MyForm_FormClosing(object sender, FormClosingEventArgs e)
{
this.Hide();
e.Cancel = true;
}
(通过蒂姆·霍夫曼)
这篇关于隐藏窗体,而不是结束时关闭按钮点击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文