From the course: Visual Basic Essential Training

Unlock this course with a free trial

Join today to access over 24,500 courses taught by industry experts.

Event driven code

Event driven code

- So far, we've focused on running code in a sub main and calling functions or subs from other classes. While this approach works well for many scenarios, there's another method for organizing program flow known as event-driven programming. This is the primary way code is executed in a Windows applications and ASP.NET applications where user interactions or system events dictate the flow of the program. Event-driven programming allows applications to respond to user actions, system events, or other triggers. In event-driven programming, the flow of the program is determined by events such as user inputs, that could be your mouse clicks, key presses, or window resizes. System events are occurrences that the operating system or a specific application uses to notify that something has happened, for example, a connection opened event is triggered when a network connection is established, a file created event is triggered when a file is created, and a timer tick event is raised every timer…

Contents