我怎样才能让一个窗体上的关闭按钮,有效地充当一个隐藏按钮?
How can I make the close button on a form effectively act as a 'Hide' button?
有没有办法中止的FormClosing
事件?
您可以只捕获的FormClosing
事件,并停止默认的动作,然后,而不是关闭窗体只是隐藏:
You could just capture the FormClosing
event and stop the default action, then instead of closing the form just hide it:
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
this.Hide();
}