Tou*_*han 17 c# dispose winforms formclosing
我正在使用MDIParent表格.当我关闭它的孩子时,孩子的对象处理.有没有办法将子可见性设置为false而不是处置?
Vim*_*987 36
默认情况下,当您关闭表单时,它将被处置.您必须覆盖Closing事件以防止它,例如:
// Use this event handler for the FormClosing event.
private void MyForm_FormClosing(object sender, FormClosingEventArgs e)
{
this.Hide();
e.Cancel = true; // this cancels the close event.
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
25988 次 |
| 最近记录: |