Declaring and Raising Events

Events are supported for classes, modules, and structures in Visual Basic .NET. You can also define shared events (refer to Chapter 11 for more on Shared methods).

The event model is designed so that you can define entities in such a way as to ensure that interactions are sustained at the interface level. (Keep in mind that the term interface is defined as the public properties, methods, and events of an entity, an instance of a class, module, or structure.)

Consider the following generic scenario. A grid control paints data in cells. When each cell paints, it needs to get data for each cell from the data provider. If the grid were implemented in such a way as to know what the cell data provider was and iterated over ...

Get Visual Basic® .NET Unleashed 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.