HtmlElementErrorEventArgs.Description プロパティ

定義

エラーを説明する文字列を取得します。

public:
 property System::String ^ Description { System::String ^ get(); };
public string Description { get; }
member this.Description : string
Public ReadOnly Property Description As String

プロパティ値

エラーを説明する文字列。

次のコード例では、このメンバーの使用方法を示します。 この例では、イベント ハンドラーがイベントの HtmlWindow.Error 発生を報告します。 このレポートは、イベントが発生したタイミングを知るのに役立ち、デバッグに役立ちます。 複数のイベントまたは頻繁に発生するイベントを報告するには、 を Console.WriteLine に置き換えるかMessageBox.Show、複数行TextBoxにメッセージを追加することを検討してください。

コード例を実行するには、 という名前HtmlWindow1の型HtmlWindowのインスタンスを含むプロジェクトに貼り付けます。 次に、イベント ハンドラーが イベントに関連付けられていることを確認します HtmlWindow.Error

private void HtmlWindow1_Error(Object sender, HtmlElementErrorEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "Description", e.Description );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Handled", e.Handled );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "LineNumber", e.LineNumber );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Url", e.Url );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "Error Event" );
}
Private Sub HtmlWindow1_Error(sender as Object, e as HtmlElementErrorEventArgs) _ 
     Handles HtmlWindow1.Error

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "Description", e.Description)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Handled", e.Handled)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "LineNumber", e.LineNumber)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Url", e.Url)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"Error Event")

End Sub

適用対象