Murach's C# 2008
How to code methods and event handlers

First, this chapter shows you how to code and call methods and how to generate event handlers for all types of events. Then, it shows you how delegates are used to wire an event to a method so you can change that wiring whenever you need to. This is an essential skill that is often treated too lightly or too late in other books.

Chapter 6 How to code methods and event handlers
How to code and call methods 160
How to code methods 160
How to call methods 162
How to use refactoring to create a new method and its calling statement 164
When and how to pass arguments by reference and by value 166
How to work with events and delegates 168
How to generate an event handler for any event 168
How event wiring works 170
How to handle multiple events with one event handler 172
Another version of the Future Value application 174
The event handlers and the CalculateFutureValue method 174
Some of the generated code 176




Murach's C# 2008

Learn more about this book

View the table of contents

Add this book to your cart



Our Ironclad Guarantee

First, try our books for 90 days. Then, if you aren't completely convinced that our books are the best ones you've ever used, you can return them for a full refund...no questions asked.