O'Reilly logo

Microsoft® Visual Basic® 2010 Developer’s Handbook by Klaus Löffelmann and Sarika Calla Purohit

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

Providing Event Parameters

If you examine the different event handling routines shown so far, you’ll soon recognize a recurring scheme in the event signatures:

Private Sub myTrigger_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles
myTrigger.Tick
    .
    .
    .
End Sub
  • Each signature contains a parameter called sender of type Object—which provides information about the event trigger. The variable sender is declared as Object, because very different objects (TextBoxes, ListBoxes, and so on) can raise an event.

  • A second parameter named e of type EventArgs (or a derivate of EventArgs)—either provides more data about the event or gives you control over the remaining chain of events. The base class System.EventArgs does not contain such additional ...

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