Events are an important part of C #. There is a demo of custom events on MSDN. After reading it for a long time, I was a little dizzy. So I created a new winform project and added a button to find the program to be called. I made a similar one-to-one comparison example and I understood it. Reading code is sometimes faster than reading a document. Therefore, it is a consistent principle. [Csharp] using System; namespace TestEventArgs {// <summary> // This class corresponds to EventArgs for comparative learning. /// Add info1 and info2. /// </Summary> public class MyEventArgs: EventArgs {private String info1; private UInt32 info2; public MyEventArgs (String info1, UInt32 info2) {this. info1 = info1; this. info2 = info2;} public String Info1 {get {return this. info1;} set {this. info1 = value ;}} public UInt32 Info2 {get {return this. info2;} set {this. info2 = value ;}}/// <summary> /// simulate the Button /// </summary> public Class MyButton {public delegate void MyEvnetHandler (object sender, MyEventArgs e ); /// <summary> /// counter of the number of Button Clicks /// </summary> public static UInt32 clicked_num = 0; public event MyEvnetHandler MyClick; public void trigger () {MyEventArgs arg = new MyEventArgs (DateTime. utcNow. toString (), ++ clicked_num); MyClick (this, arg );}} /// <summary> /// simulate Form /// </summary> public class MyForm {public MyBut Ton button; public MyForm () {button = new MyButton (); button. myClick + = new MyButton. myEvnetHandler (this. button_Clicked);} public void button_Clicked (object sender, MyEventArgs e) {Console. writeLine ("button clicked (sender is:" + sender. toString () + "; info1 =" + e. info1 + "; info2 =" + e. info2) ;}} class Program {static void Main (string [] args) {MyForm form = new MyForm (); for (int I = 0; I <10; I ++) {Www.2cto.com form. button. trigger (); System. threading. thread. sleep (500);} Console. writeLine ("Press any key to continue... "); Console. readKey () ;}} is different: 1 in this example, delegate myevnethandler is a member of the mybutton class. In the system, eventhander is a member of the system namespace.