private void toolStripButton1_Click(object sender, EventArgs e) { if (GUI.Form_Tools.Open == false) { Thread t = new Thread(new ParameterizedThreadStart( delegate { Form_Tools fSettings = new Form_Tools(); fSettings.ShowDialog(); this.CheckListeningPort(); } )); t.SetApartmentState(ApartmentState.STA); t.Name = "Settings_Form"; t.IsBackground = true; t.Start(); } }