HtmlElementErrorEventArgs 类    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
为 Error 事件提供数据。
public ref class HtmlElementErrorEventArgs sealed : EventArgs
	public sealed class HtmlElementErrorEventArgs : EventArgs
	type HtmlElementErrorEventArgs = class
    inherit EventArgs
	Public NotInheritable Class HtmlElementErrorEventArgs
Inherits EventArgs
		- 继承
 
示例
下面的代码示例演示如何禁止显示脚本错误并显示自己的自定义对话框。 此代码示例要求应用程序托管名为 WebBrowser 的 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;
}
Dim WithEvents ScriptWindow As HtmlWindow
Private Sub SuppressScriptErrors()
    If (WebBrowser1.Document IsNot Nothing) Then
        ScriptWindow = WebBrowser1.Document.Window
    End If
End Sub
Private Sub ScriptWindow_Error(ByVal sender As Object, ByVal e As HtmlElementErrorEventArgs) Handles ScriptWindow.Error
    MessageBox.Show("Suppressed error!")
    e.Handled = True
End Sub
	属性
| Description | 
		 获取与错误对应的描述性字符串。  | 
        	
| Handled | 
		 获取或设置此错误是否已由承载文档的应用程序处理。  | 
        	
| LineNumber | 
		 获取发生错误的 HTML 脚本代码行。  | 
        	
| Url | 
		 获取生成错误的文档的位置。  | 
        	
方法
| Equals(Object) | 
		 确定指定对象是否等于当前对象。 (继承自 Object) | 
        	
| GetHashCode() | 
		 作为默认哈希函数。 (继承自 Object) | 
        	
| GetType() | 
		 获取当前实例的 Type。 (继承自 Object) | 
        	
| MemberwiseClone() | 
		 创建当前 Object 的浅表副本。 (继承自 Object) | 
        	
| ToString() | 
		 返回表示当前对象的字符串。 (继承自 Object) |