c# 线程中更新UI

来源:互联网 发布:知乎 单人沙发推荐 编辑:程序博客网 时间:2024/04/27 16:52
<span style="font-size:18px;">        void Fun()        {            Invoke((EventHandler)delegate            {                textBox1.Text = "从线程中更新UI";            });        }        private void button1_Click(object sender, EventArgs e)        {            System.Threading.Thread thread = new System.Threading.Thread(Fun);            thread.Start();        }</span>

0 0