Groups | Blog | Home
all groups > c# > february 2006 >

c# : how to get the eventhandler list from an event?


i676373 NO[at]SPAM gmail.com
2/23/2006 10:50:59 PM
Hi,

I have a instance of Button, button1. button1.Click event is already
associated with some unknown event handler, e.g.

=======
button1.Click += new EventHandler(btn_click1);
button1.Click += new EventHandler(btn_click2);

How can I know the the list of eventhandler which is associated with
the event button1.Click, programmatically?

regards & thanks,
john
Larry Lard
2/24/2006 2:55:59 AM

[quoted text, click to view]

You don't. That information is private to button1. See also

<http://groups.google.com/group/microsoft.public.dotnet.languages.vb/browse_frm/thread/21585f18a4cb8aa4>
=
<http://tinyurl.com/pnyye>

--
Larry Lard
Replies to group please
Stoitcho Goutsev (100)
2/24/2006 9:54:59 AM
Only the button1 object can get the list of event handlers. Even button1 may
not be able to get this info if it inherits this event form a base class at
the base keeps the delegate field for the event private.


--
HTH
Stoitcho Goutsev (100)

[quoted text, click to view]

AddThis Social Bookmark Button