HtmlElementErrorEventArgs.Handled 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
문서를 호스팅하는 애플리케이션에서 이 오류가 처리되었는지 여부를 가져오거나 설정합니다.
public:
property bool Handled { bool get(); void set(bool value); };
public bool Handled { get; set; }
member this.Handled : bool with get, set
Public Property Handled As Boolean
속성 값
이벤트가 처리되었으면 true이고, 그렇지 않으면 false입니다. 기본값은 false입니다.
예제
다음 코드 예제에는 스크립트 오류를 표시 하지 않으려면 사용자 고유의 사용자 지정 대화 상자를 표시 하는 방법을 보여 줍니다. 이 코드 예제에서는 애플리케이션 호스트를 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
설명
이 속성을 설정 true 오류를 완전히 표시 하지 않거나 사용자에 게 고유한 사용자 지정 오류 메시지를 표시 하려는 경우.