using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Threading;//引用线程的命名空间
namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            Thread th = new Thread(new ThreadStart(aa));
            th.Start();
        }
        //创建委托
        private delegate void SetBut();
        void aa()
        {
            SetBut sb = new SetBut(weituo);
            this.Invoke(sb);
        }

        void weituo()
        {
            button1.Text = "成功了";
        }
    }
}