Events

Events are one of the more interesting additions to VB .NET and are an integral part of the C# language and the .NET platform. The event mechanism provides a method of communication or notification between objects. Consider the Windows Forms Button control. When a mouse-click event occurs, the button notifies any subscriber that a Click event has occurred. The subscriber can then perform processing based on the event received from the publisher of the event.

Subject-Observer

The event paradigm is an implementation of the Subject-Observer pattern. In the Subject-Observer model, also known as Publish-Subscribe, the Subject notifies registered Observers when the state of the Subject has changed. Figure 2.5 shows a UML, or Unified Modeling ...

Get .NET Windows® Forms Custom Controls now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.