private void StartButton_Click(object sender, EventArgs e) { if (_oldAppForm == null) { _oldAppForm = new OldAppForm(); _oldAppForm.Show(); _oldAppForm.FormClosed += new FormClosedEventHandler(OldAppForm_FormClosed); } else { MessageBox.Show("App already startet.", "Start", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void OldAppForm_FormClosed(object sender, FormClosedEventArgs e) { this._oldAppForm.Dispose(); this._oldAppForm = null; }