Little and Mickle

All things are difficult before they are easy.

导航

C#中调用控件的事件

常常需要在button1的事件中调用另button2的事件,我们可以通过直接调用button2的方法,如下:

  private void button2_Click(object sender, System.EventArgs e)
  
{
   MessageBox.Show(
"message from button 2","message");
  }


  
private void button1_Click(object sender, System.EventArgs e)
  
{
   button2_Click(
null,null);
  }

posted on 2005-08-15 18:19  davidullua  阅读(1925)  评论(0)    收藏  举报