Delegates in Visual Basic
A delegate is a form of object-oriented function pointer that allows a function to be invoked indirectly by way of a reference to the function. Delegates can be used to hook up event handlers and pass a procedure from one procedure to another.
In This Section
- Delegates and the AddressOf Operator
Provides an introduction to delegates and how they are used.
- How to: Invoke a Delegate Method
Creates a sort procedure in a class that uses the standard alphabetic sort on most list boxes, but is able to switch at run time to a custom sort procedure. To do this, you pass the custom sort procedure to the sort class at run time, using delegates.
- How to: Pass Procedures to Another Procedure in Visual Basic
Demonstrates how to use delegates to pass one procedure to another procedure.
Related Sections
- Events in Visual Basic
Overview of events in Visual Basic.
- Handling and Raising Events
Provides an overview of the event model in the .NET Framework.
- Creating Event Handlers in Windows Forms
Describes how to work with events associated with Windows Forms objects.