O'Reilly logo

Microsoft® Visual Basic® .NET 2003 Kick Start by Joel Semeniuk, Erik Porter, Andy Baron, Duncan Mackenzie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Handling Events in .NET

Event handling has changed, for the better, in .NET. I never really thought anything of it, but event procedures in Visual Basic 6.0 were attached to the appropriate object and event based solely on the procedure's name. This reliance on names meant that if you had already created and written code for CommandButton1_Click and you renamed your button to the more meaningful saveFile, your event procedure would no longer be attached to this button.

If event handling is no longer based on procedure names, how do you connect a specific event handler with an object's event? There are two ways; one combines the familiar WithEvents keyword in your variable declarations with a new keyword Handles, and the other dynamically connects ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required