public void ShowSettings() { if (InvokeRequired) { Invoke(new EmptyDelegate(ShowSettings)); return; } lock (Program.MainLock) { ApplicationSetup dlg = new ApplicationSetup(); dlg.ShowDialog(this); } }