How can we handle this exception is there some alternative or where i have to make changes?
公共表格() { 尝试 { 线程t =新线程(新的ThreadStart(StartForm)); t.Start(); Thread.sleep代码(3200); 的InitializeComponent(); t.Abort(); } catch(Exception ex) { MessageBox.Show(ex.Message); } } 线程;
public void StartForm()
{
Application.Run(new Form3());
}
private void button1_Click(object sender, EventArgs e)
{
this.Close();
th = new Thread(opennewform);
th.SetApartmentState(ApartmentState.STA);
th.Start();
}
private void opennewform(object obj)
{
Application.Run(new Form2());
}