次の方法で共有


HtmlEventArgs.PreventDefault Method

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

Specifies that the associated Document Object Model (DOM) element should not perform the default action for the current event.

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

Syntax

'Declaration
<SecuritySafeCriticalAttribute> _
Public Sub PreventDefault
[SecuritySafeCriticalAttribute]
public void PreventDefault()

Exceptions

Exception Condition
InvalidOperationException

An unexpected error occurred.

Remarks

This method mirrors calling event.returnValue = false in Internet Explorer.

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.