N
Nicky Smith
Hello,
I'm studying a book on VB.net Win apps, and I'm reading a section on
events and delegates and raising events.
Is it just me, or is this not just subs dressed up as something else?
I mean, for one, delegates point to subs, so when you call a delegate,
why not just call the sub dierectly and not bother adding the extra
code involved adding the delegate?
As for events, after delclaring an event you can raise it when
appropriate. Isn't this just the same as calling a sub or function?
Forgive me if I'm missing something life changing here, but I just
don't get it!
Can anyone help clarify the importance of user-defined events?
BTW, I do get it when controls raise events. Like the Click event for
a button. But adding events to your own classes seems exactly like
adding a standard sub.
-Nick
I'm studying a book on VB.net Win apps, and I'm reading a section on
events and delegates and raising events.
Is it just me, or is this not just subs dressed up as something else?
I mean, for one, delegates point to subs, so when you call a delegate,
why not just call the sub dierectly and not bother adding the extra
code involved adding the delegate?
As for events, after delclaring an event you can raise it when
appropriate. Isn't this just the same as calling a sub or function?
Forgive me if I'm missing something life changing here, but I just
don't get it!
Can anyone help clarify the importance of user-defined events?
BTW, I do get it when controls raise events. Like the Click event for
a button. But adding events to your own classes seems exactly like
adding a standard sub.
-Nick