p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer (http://p2p.wrox.com/forumdisplay.php?f=574)
-   -   Chap 4 exercise 4 (http://p2p.wrox.com/showthread.php?t=83323)

shaman April 17th, 2011 08:57 AM

Chap 4 exercise 4
 
Hi Stephen, I noticed in lesson 4, exercise 4 that the checkboxes are named breakfastCheckBox and etc. but the name of the events are named chkBreakfast_CheckedChanged(...). I am a VBA programmer learning C# and was just curious to why and how you have two different names between the name of the control and the connected event.

Rod Stephens April 17th, 2011 09:40 AM

Sorry about that. That's an editing inconsistency. The controls started with names like chkBreakfast and later got changed to names like breakfastCheckBox, but we missed some of the event handler names. They should all be consistent.

The only time a control's event handler shouldn't use its name is when the event handler is catching events for multiple controls. In that case, it's name should represent the group of controls rather than a single one if possible.


All times are GMT -4. The time now is 05:29 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.