button.PerformClick()

原文链接:http://blog.sina.com.cn/s/blog_81b6ca4c0101dc0t.html

button2_Click(sender,e);//A(此处为调用button2_Click方法,故不受Enabled是ture还是false限制)
button2.PerformClick();//B(此处为模拟button2的Click事件,需保证button2.Enabled==true)

你可能感兴趣的:(button.PerformClick())