this.invoke

Thread thread = new Thread(new ThreadStart(delegate
            {


                for (int i = 0; i < 100; i++)
                {
                    this.Invoke(new MethodInvoker(delegate
                    {
                        if (i == 99)
                        {
                            this.label1.Visible = false;
                            this.label1.Refresh();


                        }
                        this.label1.Text = i.ToString();
                        this.label1.Refresh();
                    }));
                }
            }));
            thread.IsBackground = true;
            thread.Start();
原文地址:https://www.cnblogs.com/server126/p/2290633.html