WebBrowser.DocumentCompleted イベントとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > WebBrowser.DocumentCompleted イベントの意味・解説 

WebBrowser.DocumentCompleted イベント

メモ : このイベントは、.NET Framework version 2.0新しく追加されたものです。

WebBrowser コントロールドキュメント読み込み終了したときに発生します

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Event DocumentCompleted As
 WebBrowserDocumentCompletedEventHandler
Dim instance As WebBrowser
Dim handler As WebBrowserDocumentCompletedEventHandler

AddHandler instance.DocumentCompleted, handler
public event WebBrowserDocumentCompletedEventHandler DocumentCompleted
public:
event WebBrowserDocumentCompletedEventHandler^ DocumentCompleted {
    void add (WebBrowserDocumentCompletedEventHandler^ value);
    void remove (WebBrowserDocumentCompletedEventHandler^ value);
}
/** @event */
public void add_DocumentCompleted (WebBrowserDocumentCompletedEventHandler
 value)

/** @event */
public void remove_DocumentCompleted (WebBrowserDocumentCompletedEventHandler
 value)
JScript では、イベント使用できますが、新規に宣言することはできません。
解説解説
使用例使用例

このイベント使用してドキュメントが完全に読み込まれた後にドキュメント印刷する方法次のコード例示します

Private Sub PrintHelpPage()

    ' Create a WebBrowser instance. 
    Dim webBrowserForPrinting As New
 WebBrowser()

    ' Add an event handler that prints the document after it loads.
    AddHandler webBrowserForPrinting.DocumentCompleted, New
 _
        WebBrowserDocumentCompletedEventHandler(AddressOf PrintDocument)

    ' Set the Url property to load the document.
    webBrowserForPrinting.Url = New Uri("\\myshare\help.html")

End Sub

Private Sub PrintDocument(ByVal
 sender As Object, _
    ByVal e As WebBrowserDocumentCompletedEventArgs)

    Dim webBrowserForPrinting As WebBrowser
 = CType(sender, WebBrowser)

    ' Print the document now that it is fully loaded.
    ' webBrowserForPrinting.Print()
    MessageBox.Show("print")

    ' Dispose the WebBrowser now that the task is complete. 
    webBrowserForPrinting.Dispose()

End Sub
private void PrintHelpPage()
{
    // Create a WebBrowser instance. 
    WebBrowser webBrowserForPrinting = new WebBrowser();

    // Add an event handler that prints the document after it loads.
    webBrowserForPrinting.DocumentCompleted +=
        new WebBrowserDocumentCompletedEventHandler(PrintDocument);

    // Set the Url property to load the document.
    webBrowserForPrinting.Url = new Uri(@"\\myshare\help.html");
}

private void PrintDocument(object sender,
    WebBrowserDocumentCompletedEventArgs e)
{
    // Print the document now that it is fully loaded.
    ((WebBrowser)sender).Print();

    // Dispose the WebBrowser now that the task is complete. 
    ((WebBrowser)sender).Dispose();
}
.NET Framework のセキュリティ.NET Frameworkセキュリティ
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
WebBrowser クラス
WebBrowser メンバ
System.Windows.Forms 名前空間
WebBrowser.DocumentStream プロパティ
WebBrowser.DocumentText プロパティ
GoBack
GoForward
GoHome
GoSearch
Navigate
Navigated
Navigating
WebBrowser.Url プロパティ
WebBrowserDocumentCompletedEventArgs
WebBrowserDocumentCompletedEventHandler
その他の技術情報
イベント利用



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「WebBrowser.DocumentCompleted イベント」の関連用語

WebBrowser.DocumentCompleted イベントのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



WebBrowser.DocumentCompleted イベントのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS