在button1的click事件中用以下方法
1  button2_Click(null,null);
2  button2.PerformClick();
3  InvokeOnClick(button2,null);
4  将事件处理程序写成函数,在button1里调用
5  button1.Click+=new EventHandler(button2_click)。但是这种方法太呆板,最好不用。

解决方案 »

  1.   

    在button1的click事件中用以下方法
    1  button2_Click(null,null);
    2  button2.PerformClick();
    3  InvokeOnClick(button2,null);
    4  将事件处理程序写成函数,在button1里调用
    5  button1.Click+=new EventHandler(button2_click)。但是这种方法太呆板,最好不用。
      

  2.   

    假设此按钮的父容器为public class TestForm : System.Windows.Forms.Form
    可用如下方法得到按钮的父容器,再调用容器内的事件
    TestForm parent=(TestForm) button1.Parent;
    parent.TestForm_Click(sender,e);