How can we handle this exception is there some alternative or where i have to make changes?
public Form() { try { Thread t = new Thread(new ThreadStart(StartForm)); t.Start(); 线程.睡眠(3200);初始化组件();t.Abort(); } 捕捉(异常前) { MessageBox.Show(ex.Message); } } 线程th;
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());
}