I. How events run
The event receiver has a method to execute the event processing program when a registered event occurs and use the delegate as the intermediary between the sender and receiver. The sender defines the delegate to be used by the receiver, the receiver registers the event handler to the event.
Form constructor:
EventHandler is the delegate that an event is used to assign a handler (Button_Click) to an event (Click ).
The EventHandler delegate has been defined by. NET Framework, so you must use it for all defined events. The same signature must be used:
1. It must be void and the event handler cannot return values.
2. The object parameter is the object that triggers the event. Therefore, you can assign an event to multiple objects. For example, you can determine which button is based on the sender;
3. EventArgs is an object that contains events and other information. It can be of any type, as long as it is derived from EventArgs.
Ii. Create an event
By: dxh_0829