S
Sergio Geralnik
I am trying to use this method to get a MethodInfo object
but the method always returns a null.
See my sample code below:
this.button1 = new System.Windows.Forms.Button();
this.button1.Click += new System.EventHandler
(this.button1_Click);
private void button1_Click(object sender, System.EventArgs
e)
{
EventInfo eventInfo = (sender as Button).GetType().GetEvent
("Click");
// This line always results in raiseMethod being null
MethodInfo raiseMethod = eventInfo.GetRaiseMethod();
}
Thanks for any help.
but the method always returns a null.
See my sample code below:
this.button1 = new System.Windows.Forms.Button();
this.button1.Click += new System.EventHandler
(this.button1_Click);
private void button1_Click(object sender, System.EventArgs
e)
{
EventInfo eventInfo = (sender as Button).GetType().GetEvent
("Click");
// This line always results in raiseMethod being null
MethodInfo raiseMethod = eventInfo.GetRaiseMethod();
}
Thanks for any help.