Public Class Foo
Public Event Bar
...
behind the scenes VB creates a hidden (from IntelliSense) delegate
class BarEventHandler and an instance of that class BarEvent; and that
I can look at BarEvent.GetInvocationList to see who is watching for
this event.
That's all OK.
But now I have a (Windows Forms) Control, which has a TextChanged
event, and I want to see who's hooked up to this event. There doesn't
seem to be a TextChangedEvent (fair enough, can't ask VB.NET to create
this for everything it encounters). So how can I get the invocation
list?
(I went over to the C# group and looked for similar questions, since
they never get auto-generated stuff. But I found only this question
being asked, and no answers)
Thanks,
--
Larry Lard
Replies to group please
Long answer: Most components, inheriting from
System.ComponentModel.Component, store their invocation list "by key" in
Component.Events. The "key" (again being an implementation detail) is known
only to the specific class that defines the event. For detail on the Events
property see:
For details on using System.ComponentModel.EventHandlerList (what the Events
property returns) see:
http://weblogs.asp.net/justin_rogers/archive/2004/09/22/232834.aspx
For a writeup of how to use it in VB.NET 2005 see:
http://msdn2.microsoft.com/library/yt1k2w4e(en-us,vs.80).aspx
NOTE: Current versions of VB.NET is not able to define the AddHandler &
RemoveHandler methods needed by Events to actually use the Events property,
VS.NET 2005 (due out late in 2005) will be able to use them. C# currently
can define add & remove methods for events...
Hope this helps
Jay
"Larry Lard" <larr...@hotmail.com> wrote in message
news:1121254572.4...@z14g2000cwz.googlegroups.com...