private void button1_Click(object sender, EventArgs e) { f.Show(); f.Visible = false; f.Show(); f.Visible = false; new Thread(new ThreadStart(FunGo)).Start(); f.ShowDialog(this); } Form1 f = new Form1(); private void FunGo() { int i = 0; while (true) { f.Invoke(new MethodInvoker(delegate() { if(i<=100) f.Listen(i, 100); })); if (i == 100) { f.Invoke(new MethodInvoker(delegate() { f.Close();//when the progress ba does not show 100% ,the Form (f) closes })); break; } Thread.Sleep(100); i++; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)