private void mapButton_Click(object sender, EventArgs e) { if (currentProject.Cart == null) { MessageBox.Show("The map is not available until you load a cartridge.", "Come on!", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } if (mapForm != null) { mapForm.BringToFront(); } else { mapForm = new MapForm(this); mapForm.FormClosed += mapForm_FormClosed; mapForm.Show(); } }
private void mapForm_FormClosed(object sender, FormClosedEventArgs e) { mapForm = null; }