共用方式為


HtmlObject.DetachEvent Method (String, EventHandler)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Detaches the specified.NET Framework event handler (EventHandler) from the specified event on the current Document Object Model (DOM) object.

Namespace:  System.Windows.Browser
Assembly:  System.Windows.Browser (in System.Windows.Browser.dll)

Syntax

'Declaration
Public Sub DetachEvent ( _
    eventName As String, _
    handler As EventHandler _
)
public void DetachEvent(
    string eventName,
    EventHandler handler
)

Parameters

Exceptions

Exception Condition
ArgumentException

eventName is an empty string.

ArgumentNullException

eventName is nulla null reference (Nothing in Visual Basic).

-or-

handler is nulla null reference (Nothing in Visual Basic).

Remarks

If the event that is specified in eventName does not exist, no action is taken and a nulla null reference (Nothing in Visual Basic) value is returned for the event cookie.

If there is currently no registration for the eventName with the specified handler, no action is taken.

Version Information

Silverlight

Supported in: 5, 4, 3

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.