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(); Thread.Sleep(3200); InitializeComponent(); t.Abort(); } catch(Exception ex) { 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());
}