首页 > 代码库 > 更新UI

更新UI

            //1.
            this.Invoke(new ThreadStart(delegate
            {
                textBox1.AppendText("11111" + "\r\n");
            }));
            //2.
            this.Invoke(new MethodInvoker(delegate
            {
                textBox1.AppendText("11111" + "\r\n");
            }));
            //3.
            this.Invoke(new Action(
            () => { textBox1.AppendText("11111" + "\r\n"); }));
            //4.
            this.Invoke(new EventHandler(delegate
            {
                 textBox1.AppendText("11111" + "\r\n");
            }));

 

更新UI