//按钮事件

private void btn_Click(object sender, EventArgs e)

{}

//自己的函数

private void myFunc()

{
  //程序中其他地方调用按钮事件

  btn_Click(this, new EventArgs());//这样传sender和e参数就可以,this代表当前程序所在的control,new EventArgs()代表初始化EventArgs类的一个新实例

}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2022-01-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-21
  • 2021-08-05
  • 2021-05-03
  • 2022-12-23
  • 2022-03-05
  • 2021-08-29
相关资源
相似解决方案