O'Reilly logo

Visual Basic .NET Programming Language, The by Paul Vick

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 12. Events and Delegates

A frequent design pattern in Windows programs is to write code that is triggered when a specific situation occurs (such as clicking a button) and then reacts to the event in some way. For example, when the menu item Exit is selected, the application might shut itself down, or when a button called Refresh is clicked, the application might refresh the data it is showing on the screen. This style of programming is called event-driven programming because the action in a program is driven by reacting to events. In event-driven programming, a type declares the events that it exposes. Then when an event occurs, the type raises the event and other types handle the event.

There are two ways of handling an event: declaratively ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required