473,383 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

EventInfo.GetRaiseMethod() always returns null

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.
Nov 22 '05 #1
1 4435
Sergio,
I am trying to use this method to get a MethodInfo object
but the method always returns a null.


I don't know which method's MethodInfo you want to retrieve, but
events generated by the C# compiler (or VB.NET) never have a raise
method associated with them (it's optional) so that's why
GetRaiseMethod always will return null for those events.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Stefan Weiss | last post by:
Hi. The manual for pg_fetch_result() reads: | All forms of integer types are returned as integer values. All | forms of float, and real types are returned as float values. Boolean | is...
2
by: Rene van Hoek | last post by:
Hi, I am using Xalan 1.8.0 and Xerces 2.6.0 in C++. I have an XML document which I first transform into an other XML document using an XSL styelsheet. Then I want to parse with XPathEvaluator...
1
by: Sergio Geralnik | last post by:
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 +=...
9
by: fochie | last post by:
Greetings, I'm having a problem when I try to GET a file from my server via xmlhttp when using Mozilla. With IE I can get any type of file fine, get/display headers fine, etc. With Mozilla,...
8
by: Brian | last post by:
This is causing me to not be able to create a relation in my dataset. Here's my code: dc1 = ds.Tables .Columns ; dc2 = ds.Tables .Columns ; dr1 = new System.Data.DataRelation...
0
by: Zoury | last post by:
Hi folks ! :O) Let's say I have the following EventHandler defined in a class : '*** Option Explicit On Public Delegate Sub MyEventHandler(ByVal sender As Object, ByVal e As MyEventArgs) ...
10
by: Lyle Fairfield | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaac11/html/acfctNZ_HV05186465.asp "If the value of the variant argument is Null, the Nz function returns the number zero or a...
3
by: axlq | last post by:
I wrote the function below to get the vertical scroll position of an anchor. That is, a URL of the form http://www.example.com/mypage.html#anchorname should scroll to the point on the page that...
6
by: Java script Dude | last post by:
Small glitch (IMHO) in JavaScript is related to isNaN() boolean function. If passed a null, it returns true which is incorrect. This one cause me quite a bit of grief until I detected it and was...
9
by: Francois Grieu | last post by:
When running the following code under MinGW, I get realloc(p,0) returned NULL Is that a non-conformance? TIA, Francois Grieu #include <stdio.h> #include <stdlib.h>
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.