Events and Delegates
Events are part of what we call the Callback Mechanism. One way of looking at OOP is by using a communications paradigm. Objects communicate with each other by sending and receiving messages. Messages are received using methods and properties. Messages are sent via callbacks or events. Classes can fire events anytime they want to notify any class that’s listening for some action. The class that’s listening for the event can then take appropriate action, or do nothing. Thus we can say that we have event senders and event listeners. Another more academic way of saying this is that there are event sources and event sinks. VB provides a very robust event system.
The first and most basic way of creating and using events is as ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access