How to: Create Event Handlers Using the Designer
In nearly all applications, it is essential to respond to user or system events. You can create event handlers using the Properties window, as discussed in the following procedure. For more information about creating default-named event handlers, see How to: Create Default Event Handlers on the Windows Forms Designer.
The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Customizing Development Settings
To create an event handler on the Windows Forms designer
Click the form or control that you want to create an event handler for.
In the Properties window, click the Events button ().
In the list of available events, click the event that you want to create an event handler for.
In the box to the right of the event name, type the name of the handler and press ENTER.
Name the event handler according to the functionality of the event; for example, for theClick event, you can typeStartProcess as the event handler.
The Code Editor appears, showing the code for the form, and an event handler method is generated in your code similar to that shown in the following code example.
Add the appropriate code to the event handler.