this.button1.Click -= new System.EventHandler(this.button1_Click);
this.button1.Click +=new System.EventHandler(this.testok);
this.button1.Click +=new System.EventHandler(this.testok);
解决方案 »
- 求助:C# 控制台中操作剪辑板出错
- System.Diagnostics.Process关于这个东西能否远程打开
- dataGridView中超链接问题
- 设置DataGridView里的ValueType的方法
- 请问怎么在程序里设计一个button,点了它就可以打开别的程序?就是点了button就可以打开指定路径的在我系统里的其他程序,button里的事件怎么写?
- c#中的输入~
- 有没有人写过把DataGrid中的数据导出为任意格式的数据库文件?
- 请大家给几个详细的用水晶报表的例子吧!谢谢
- 跪求怎样保存DataGrid中的修改
- c# crystal reports
- 怎样在程序中手动调用treeview的treeView1_AfterSelect事件?
- (winform)如何取消DataGrid的编辑模式?
但是如果在下面的语句中
this.button1.Click -= new System.EventHandler(this.button1_Click);
如果 this.button1_Click 这个函数名是未知的动态的
就是说不知道当前要 减去的 到底是 testok 还是 button1_Click
或者说 函数名根本不知道 怎么 做到呢?怎样才能得到当前的 EventHandler 呢?
需要this.button1.Click -= new System.EventHandler(this.button1_Click);
先
在绑定之前减去所有的?
然后在 做 += ?
我觉的这样不大好
难道真的没有 好的办法?
mydelegate += new MyDelegate1(Event11);
testEvent.Event1 += new MyDelegate1(Event11);;foreach(MyDelegate1 d in mydelegate.GetInvocationList())
{
MessageBox.Show( d.Method.Name);
}