public void OpenForm2() { if (_form02 == null) { _form02 = new Form02(); _form02.MdiParent = this; _form02.FormClosed += new FormClosedEventHandler(form02_FormClosed); _form02.Show(); } else { _form02.Activate(); } }
private void form02ToolStripMenuItem_Click(object sender, EventArgs e) { if (_form02 == null) { _form02 = new Form02(); _form02.MdiParent = this; _form02.FormClosed += new FormClosedEventHandler(form02_FormClosed); _form02.Show(); } else { _form02.Activate(); } }
private void btnOpenForm2_Click(object sender, EventArgs e) { if (_form02 == null) { _form02 = new Form02(); _form02.MdiParent = _mdiParentForm; _form02.FormClosed += new FormClosedEventHandler(form02_FormClosed); _form02.Show(); } else { _form02.Activate(); } }
void form02_FormClosed(object sender, FormClosedEventArgs e) { _form02 = null; }