DoWorkEventHandler デリゲートとは? わかりやすく解説

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

DoWorkEventHandler デリゲート

メモ : このデリゲートは、.NET Framework version 2.0新しく追加されたものです。

DoWork イベント処理するメソッド表します。このクラス継承できません。

名前空間: System.ComponentModel
アセンブリ: System (system.dll 内)
構文構文

Public Delegate Sub DoWorkEventHandler
 ( _
    sender As Object, _
    e As DoWorkEventArgs _
)
Dim instance As New DoWorkEventHandler(AddressOf
 HandlerMethod)
public delegate void DoWorkEventHandler (
    Object sender,
    DoWorkEventArgs e
)
public delegate void DoWorkEventHandler (
    Object^ sender, 
    DoWorkEventArgs^ e
)
/** @delegate */
public delegate void DoWorkEventHandler (
    Object sender, 
    DoWorkEventArgs e
)
JScript では、デリゲート使用できますが、新規に宣言することはできません。

パラメータ

sender

イベントソース

e

イベント データ格納している DoWorkEventArgs。

解説解説
使用例使用例

DoWorkEventHandler デリゲート使用して DoWork イベント処理する方法を示すコード例次に示します。完全なコードの一覧については、「方法 : バックグラウンド操作実行する」を参照してください

Private Sub backgroundWorker1_DoWork( _
sender As Object, e As DoWorkEventArgs)
 _
Handles backgroundWorker1.DoWork

   ' Do not access the form's BackgroundWorker reference directly.
   ' Instead, use the reference provided by the sender parameter.
   Dim bw As BackgroundWorker = CType( sender,
 BackgroundWorker )
   
   ' Extract the argument.
   Dim arg As Integer =
 Fix(e.Argument)
   
   ' Start the time-consuming operation.
   e.Result = TimeConsumingOperation(bw, arg)
   
   ' If the operation was canceled by the user, 
   ' set the DoWorkEventArgs.Cancel property to true.
   If bw.CancellationPending Then
      e.Cancel = True
   End If

End Sub   
private void backgroundWorker1_DoWork(object
 sender, DoWorkEventArgs e)
{
    // Do not access the form's BackgroundWorker reference directly.
    // Instead, use the reference provided by the sender parameter.
    BackgroundWorker bw = sender as BackgroundWorker;

    // Extract the argument.
    int arg = (int)e.Argument;

    // Start the time-consuming operation.
    e.Result = TimeConsumingOperation(bw, arg);

    // If the operation was canceled by the user, 
    // set the DoWorkEventArgs.Cancel property to true.
    if (bw.CancellationPending)
    {
        e.Cancel = true;
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


このページでは「.NET Framework クラス ライブラリ リファレンス」からDoWorkEventHandler デリゲートを検索した結果を表示しています。
Weblioに収録されているすべての辞書からDoWorkEventHandler デリゲートを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からDoWorkEventHandler デリゲート を検索

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

辞書ショートカット

すべての辞書の索引

DoWorkEventHandler デリゲートのお隣キーワード
検索ランキング

   

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



DoWorkEventHandler デリゲートのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS