private void button2_Click(object sender, EventArgs e) { Thread t = new Thread(new ThreadStart(() => { PlotMainWindow.application = null; PlotMainWindow plotPlato = new PlotMainWindow(); plotPlato.Show(); System.Windows.Threading.Dispatcher.Run(); })); t.SetApartmentState(ApartmentState.STA); // Make the thread a background thread t.IsBackground = true; // Start the thread t.Start(); }
private void buttonTest_Click(object sender, EventArgs e) { PlotMainWindow plotPlato = new PlotMainWindow(); System.Windows.Forms.Integration.ElementHost.EnableModelessKeyboardInterop(plotPlato); plotPlato.Show(); }