Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Events vs delegates (Lesson 9)

Sorry guys, hate to go back a bit. I'm used to using function pointers and simply overriding methodes. So when I hear delegates, I'm thinking speed lost, ineficiency?

Anyway, I've been messing around with events and delegates, and I can`t seem to find the difference between them.
(i.e What is the purpose of the "event" keyword???!!!)
All I've come up with so far is that you can declare events in an interface? correct?

When working with windows controls and forms you usually only add one methode reference to an event. It seems more efficient to just overide the On methode. (eg. OnPaint, OnClick ...) If necessary, one can then call the base methode. Doing this in child objects is much simpler/efficient? So why the need for delegates. (Obviously, with delegates/events, you can add methodes from another object, what other advantages ? )

Any comments or notes, plsssss
Thanks,
Zoq
Sign In or Register to comment.