BackgroundWorker.CancelAsync メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > BackgroundWorker.CancelAsync メソッドの意味・解説 

BackgroundWorker.CancelAsync メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

保留中のバックグラウンド操作キャンセル要求します

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

Dim instance As BackgroundWorker

instance.CancelAsync
public void CancelAsync ()
public:
void CancelAsync ()
public void CancelAsync ()
例外例外
例外種類条件

InvalidOperationException

WorkerSupportsCancellation が false です。

解説解説
使用例使用例

CancelAsync メソッド使用して非同期 ("バックグラウンド") 操作キャンセルするコード例次に示します。このコード例は、BackgroundWorker クラストピック取り上げているコード例一部分です。

Private Sub cancelAsyncButton_Click( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles cancelAsyncButton.Click
    
    ' Cancel the asynchronous operation.
    Me.backgroundWorker1.CancelAsync()

    ' Disable the Cancel button.
    cancelAsyncButton.Enabled = False
    
End Sub 'cancelAsyncButton_Click
private void cancelAsyncButton_Click(System.Object
 sender, 
    System.EventArgs e)
{   
    // Cancel the asynchronous operation.
    this.backgroundWorker1.CancelAsync();

    // Disable the Cancel button.
    cancelAsyncButton.Enabled = false;
}
void cancelAsyncButton_Click( System::Object^ /*sender*/, System::EventArgs^
 /*e*/ )
{  
   // Cancel the asynchronous operation.
   this->backgroundWorker1->CancelAsync();
   
   // Disable the Cancel button.
   cancelAsyncButton->Enabled = false;
}
private void cancelAsyncButton_Click(Object
 sender, System.EventArgs e)
{   
    // Cancel the asynchronous operation.
    this.backgroundWorker1.CancelAsync();

    // Disable the Cancel button.
    cancelAsyncButton.set_Enabled(false);
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照


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

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

辞書ショートカット

すべての辞書の索引

BackgroundWorker.CancelAsync メソッドのお隣キーワード
検索ランキング

   

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



BackgroundWorker.CancelAsync メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2024 GRAS Group, Inc.RSS