stevegray
4Penny.net
Points: 65959

6/30/2026 11:12:21 AM

How to use Delegates in Winforms

* This article, and all our great .NET Development documentation, Is available on the .NET Development menu

Delegates are a tool to raise an event from one class to another, from one form to another, or any combination.

Let's say that you have a form that shows customers, and a popup dialog that gives you a grid of customers to choose from. We'd like to raise an event in the frmChooseCustomer to let frmCustomerEdit know that a customer has been chosen. So, lets start in frmChooseCustomer:

There are four tasks:

4Penny.net
Version: All
Section: .NET Development
Table Definition Quick Links
All Tables
SOP Tables
RM Tables
GL Tables
POP Tables
HR Tables
PM Tables
UPR Tables
IV Tables
Olympic Tables
3