HtmlElementErrorEventArgs Class
TOC
Collapse the table of content
Expand the table of content

HtmlElementErrorEventArgs Class

 

Provides data for the Error event.

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

System.Object
  System.EventArgs
    System.Windows.Forms.HtmlElementErrorEventArgs

public sealed class HtmlElementErrorEventArgs : EventArgs

NameDescription
System_CAPS_pubpropertyDescription

Gets the descriptive string corresponding to the error.

System_CAPS_pubpropertyHandled

Gets or sets whether this error has been handled by the application hosting the document.

System_CAPS_pubpropertyLineNumber

Gets the line of HTML script code on which the error occurred.

System_CAPS_pubpropertyUrl

Gets the location of the document that generated the error.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

The following code example demonstrates how to suppress a script error and display your own custom dialog box. This code example requires that your application host a WebBrowser control named webBrowser1.

private void SuppressScriptErrors()
{
	if (webBrowser1.Document != null)
	{
              webBrowser1.Document.Window.Error += new HtmlElementErrorEventHandler(scriptWindow_Error);
	}
}

private void  scriptWindow_Error(object sender, HtmlElementErrorEventArgs e)
{
		MessageBox.Show("Suppressed error!");
	e.Handled = true;
}

.NET Framework
Available since 2.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft