473,406 Members | 2,816 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,406 software developers and data experts.

how to get the eventhandler list from an event?

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

Feb 24 '06 #1
2 3321

i6*****@gmail.com wrote:
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?


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

Feb 24 '06 #2
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)

<i6*****@gmail.com> wrote in message
news:11**********************@t39g2000cwt.googlegr oups.com...
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

Feb 24 '06 #3

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

Similar topics

3
by: Remco | last post by:
Hello, Serverside I'm generating a html page. There are different controls for which I want to create an eventhandler manually. Like: document.forms.TextBox1.onchange = EventHandler;...
3
by: Matias Szulman | last post by:
Hi! I need to know if an event (i.e. button1_click) has an eventhandler associated. Is this possible in c#? Thanks, Matias
12
by: aplaxas | last post by:
Hi! "CDemo.Call" eventHandler is added to "button3.click" Event when both button1 and button2 are clicked. However, I want to add "cd.Call" only one time even though I clicked both button1 and...
5
by: JMWilton | last post by:
Is there a way to determine what has been added to the eventhandler list? I have code that uses += and -= to turn event handling code on and off. Apparently, it is possible to add the same event...
2
by: Wiktor Zychla | last post by:
Let's start with an example: if you have: class Test { public delegate int MyDelegate( int n ); event MyDelegate MyEvent; } then you can get MyEvent using reflection:
4
by: DotNetJunky | last post by:
I have built a control that runs an on-line help system. Depending on the category you selected via dropdownlist, it goes out and gets the child subcategories, and if there are any, adds a new...
9
by: Christopher Weaver | last post by:
Can anyone tell me how I could iterate through a collection of controls on a form while assigning their event handlers to another identical collection of controls on the same form. So far,...
5
by: Carlo \(mcp\) | last post by:
Good morning I have this lines: AddHandler MyControl1.Parent.Paint, AddressOf PaintParentHandler AddHandler MyControl2.Parent.Paint, AddressOf PaintParentHandler AddHandler...
4
by: Sascha Dietl | last post by:
hi, i wrote my own generic class based on IList that fires events, so it's just a better List<class. When my "EventedList" fires an event I don't want to take "this" as sender instead i would...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.