Ok Chris Love, this one's for you. Here is how you create an event handler in C# using Visual Studio.
Here is a form I built in a matter of seconds. I know, we'll discuss my mad design skills later.
Let's pretend I was in the code behind and wanted to create a Form Load event. In the code behind within the constructor start typing until you find the event you want to create as shown here:
Once located press <Enter> to auto complete the name. Here is the step that a lot of people miss. Type the operator += and watch what happens.
Visual Studio will give you a notification to press TAB to insert the EventHandler.
Pressing TAB will then give you this:
It is at this point if you press TAB again, the callback method will be generated. Thus when you do += press TAB TAB (2 tabs).
How many key strokes was that? Let's see. I had to type in my form the characters: this.Lo <enter> += TAB TAB. Easy quick and simple.
posted @ Monday, July 07, 2008 6:08 PM