private void automobilToolStripMenuItem_Click(object sender, EventArgs e) { if (frmAutomobil == null) { frmAutomobil = new FrmAutomobil(); frmAutomobil.MdiParent = this; frmAutomobil.Show(); frmAutomobil.Closed += frmAutomobil_Closed; } else { frmAutomobil.Focus(); } }
void frmAutomobil_Closed(object sender, EventArgs e) { frmAutomobil = null; }