private void button3_Click(object sender, EventArgs e) { FrmFlexLabelTest dialog = new FrmFlexLabelTest(); Thread th = new Thread(new ThreadStart(dialog.Show)); th.Start(); Thread.Sleep(5000); dialog.Invoke(new ThreadStart(dialog.Close)); }
private void button4_Click(object sender, EventArgs e) { FrmFlexLabelTest dialog = new FrmFlexLabelTest(); Thread th = new Thread(new ParameterizedThreadStart(this.Run)); th.Start(dialog); Thread.Sleep(5000); dialog.Invoke(new ThreadStart(dialog.Close)); }
private void button2_Click(object sender, EventArgs e) { FrmFlexLabelTest dialog = new FrmFlexLabelTest(); dialog.Show(); //this.Enabled = false; //for (int i = 0; i < 100000; ++i) //{ // Console.WriteLine(i); //} //this.Enabled = true; Thread.Sleep(5000); //dialog.Close(); }