Welcome to Atlanta .NET Regular Guys Sign in | Join | Help

VBisms will get me in the end

So I've got an object.  My object exposes a few public events.  Now, being an enterprising developer, I want to take advantage of these events and add code which will actually DO something when these events get fired.

In C# I'd write MyObject.MyEvent += New EventHandler(MyFunction that I want called).  This code looks remarkably like the code used for delegates and actually makes sense to me.

In VB I get an error when I refer to MyObject.MyEvent and it doesn't offer any helpful advice as to what I've done wrong.  Finally, looking in the help files at EventHandler shows me that I'm missing a VB keyword - AddHandler.

Le sigh

-- Matt Ranlett
Published 15-02-2006 10:45 by Matt Ranlett
Filed Under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

What do you think?

(required) 
(optional)
(required) 

About Matt Ranlett

One of the two original Atlanta .NET Regular Guys, Matt fills his free time by helping to run several Atlanta area user groups, the Atlanta Code Camps, and works as one of the two INETA co-Vice Presidents of Technology
SkinName:iroha_Blog2
Powered by Community Server, by Telligent Systems