Murach's C# 2005
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 154
How to code methods 154
How to call methods 156
How to use refactoring to create a new method and its calling statement 158
When and how to pass arguments by reference and by value 160
How to work with events and delegates 162
How to generate an event handler for any event 162
How event wiring works 164
How to handle multiple events with one event handler 166
Another version of the Future Value application 168
The event handlers and the CalculateFutureValue method 168
Some of the generated code 170




Murach's C#

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.