BackgroundWorker.IsBusy プロパティ
アセンブリ: System (system.dll 内)



IsBusy プロパティを使用して、BackgroundWorker 操作の完了を待機する方法を次のコード例に示します。次のコード例は、「方法 : バックグラウンドでファイルをダウンロードする」で示されている例の一部です。
Private Sub dowloadButton_Click( _ ByVal sender As Object, _ ByVal e As EventArgs) _ Handles dowloadButton.Click ' Start the download operation in the background. Me.backgroundWorker1.RunWorkerAsync() ' Disable the button for the duration of the download. Me.dowloadButton.Enabled = False ' Wait for the BackgroundWorker to finish the download. While Me.backgroundWorker1.IsBusy ' Keep UI messages moving, so the form remains ' responsive during the asynchronous operation. Application.DoEvents() End While ' The download is done, so enable the button. Me.dowloadButton.Enabled = True End Sub
private void dowloadButton_Click(object sender, EventArgs e) { // Start the download operation in the background. this.backgroundWorker1.RunWorkerAsync(); // Disable the button for the duration of the download. this.dowloadButton.Enabled = false; // Wait for the BackgroundWorker to finish the download. while (this.backgroundWorker1.IsBusy) { // Keep UI messages moving, so the form remains // responsive during the asynchronous operation. Application.DoEvents(); } // The download is done, so enable the button. this.dowloadButton.Enabled = true; }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からBackgroundWorker.IsBusy プロパティを検索する場合は、下記のリンクをクリックしてください。

- BackgroundWorker.IsBusy プロパティのページへのリンク