RemoveHandler Statement


RemoveHandler Statement

Syntax

     RemoveHandler nameOfEventSender, AddressOf nameOfEventHandler 


nameOfEventSender (required)

The name of a class or object instance and its event, such as Button1.Click


nameOfEventHandler (required)

The name of a subroutine to remove from the set of active event handlers for nameOfEventSender

Description

The RemoveHandler statement removes a previous binding of an event handler to an event.

Usage at a Glance

The AddHandler and RemoveHandler statements can be used to add and remove event notification handlers dynamically at runtime. By contrast, the Handles keyword establishes an event notification handler for the lifetime of an object.

Example

Chapter 8 includes examples of using event handlers.

Version Differences

Visual Basic 2005 includes a new Custom Event statement that impacts the use of the RemoveHandler statement. See the Custom Event Statement entry in this chapter for additional information.

See Also

AddHandler Statement, Custom Event Statement




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net