private void WorldButton_Click(object sender, EventArgs e) { if (worldFormOpen) { //MessageBox.Show("Can only open one world view at a time."); if (worldForm != null) { worldForm.Invoke(new Action(() => { worldForm.Focus(); })); } return; } Thread thread = new Thread(new ThreadStart(() => { try { worldFormOpen = true; using (WorldForm f = new WorldForm()) { worldForm = f; f.ShowDialog(); worldForm = null; } worldFormOpen = false; } catch { worldFormOpen = false; } })); thread.Start(); }