首页  编辑  

通过一个方法名赋值一个事件

Tags: /C#/RTTI/   Date Created:

using System . Reflection;

EventInfo vEventInfo = typeof ( Button ) . GetEvent( "Click" );

vEventInfo . AddEventHandler(button2,

    Delegate . CreateDelegate(vEventInfo . EventHandlerType, this , "button1_Click" ));