0
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());

    }

これは、この例外のスクリーン ショットです。

4

0 に答える 0