private void button2_Click(object sender, EventArgs e) { // button1.BackColor = SystemColors.ButtonHighlight; System.Threading.Thread userThead = new System.Threading.Thread(new System.Threading.ThreadStart(ChangeBackGround)); userThead.IsBackground = true; userThead.Start(); } private void ChangeBackGround() { // button1.BackColor = SystemColors.ButtonHighlight; //button1.BeginInvoke((Action)(() => button1.BackColor = SystemColors.ButtonHighlight)); button1.BeginInvoke((MethodInvoker)(() => button1.BackColor = SystemColors.ButtonHighlight)); }
转载于:https://www.cnblogs.com/ganquanfu2008/archive/2013/05/05/3061297.html