Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Event Handlers in Visual Basic and Visual C#

Visual Studio .NET 2003

You can use events to notify objects when interesting things happen. You can associate methods with particular events; these methods are called event handlers. When an event is raised, the event handler(s) that receive the event are executed. Events can be assigned to multiple handlers, and the methods that handle particular events can be changed dynamically.

There are subtle differences in the way that Visual Basic and Visual C# implement events and event handling. Those aspects that are similar for both languages are discussed in the same topic. Those aspects that different are discussed in language-specific topics.

In the Visual Basic and Visual C# Documentation

Event Handling in Windows Forms
Provides links to a variety of topics on handling events in Windows Forms for Visual Basic and Visual C#.
Server Event Handling in Web Forms Pages
Provides links to several topics discussing handling server events in Web Forms pages for Visual Basic and Visual C#.

In the Visual C# Reference Documentation

Events Tutorial
Demonstrates how to declare, raise, and handle events using Visual C#.
Events Sample
Provides sample code demonstrating event handling with Visual C#.

In the Visual Basic Reference Documentation

Events and Delegates
Provides links to Visual Basic-specific topics on using events.
Event Implementation for Components and Custom Controls with Visual Basic
Discusses implementing events and event handlers in custom controls and components with Visual Basic.

Additional Information

Handling and Raising Events
Provides links to topics on handling and raising events using the .NET Framework.
Events in ASP.NET Server Controls
Describes how to raise events from custom ASP.NET server controls.
Events and Delegates
Provides an overview of the event model and describes delegates in the .NET Framework.
© 2015 Microsoft