HtmlElementErrorEventArgs 類別

定義

提供 Error 事件的資料。

public ref class HtmlElementErrorEventArgs sealed : EventArgs
public sealed class HtmlElementErrorEventArgs : EventArgs
type HtmlElementErrorEventArgs = class
    inherit EventArgs
Public NotInheritable Class HtmlElementErrorEventArgs
Inherits EventArgs
繼承
HtmlElementErrorEventArgs

範例

下列程式碼範例示範如何隱藏腳本錯誤,並顯示您自己的自訂對話方塊。 此程式碼範例會要求您的應用程式裝載 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)

適用於

另請參閱