C
cmdolcet69
Im having an issue setting back my databackgroundworker.is busy to
false. I call the CancelAsync() however it doesn;t cancel anything
with the backgroundworker.
What else can I do. I can;t set the .Isbusy because its read-only
Public Sub StopAllDataBackgroundThreads()
Me.tmrBackgroundWorker.Enabled = False
Me.tmrBackgroundWorker2.Enabled = False
If Not IsNothing(Me.dataBackgroundWorker) Then
If dataBackgroundWorker.IsBusy Then
Me.dataBackgroundWorker.CancelAsync()
While dataBackgroundWorker.IsBusy
Application.DoEvents()
Me.dataBackgroundWorker.CancelAsync()
End While
Me.dataBackgroundWorker.Dispose()
End If
End If
If Not IsNothing(Me.dataBackgroundWorker2) Then
If dataBackgroundWorker2.IsBusy Then
Me.dataBackgroundWorker2.CancelAsync()
While dataBackgroundWorker2.IsBusy
Application.DoEvents()
Me.dataBackgroundWorker2.CancelAsync()
End While
Me.dataBackgroundWorker2.Dispose()
End If
End If
End Sub
false. I call the CancelAsync() however it doesn;t cancel anything
with the backgroundworker.
What else can I do. I can;t set the .Isbusy because its read-only
Public Sub StopAllDataBackgroundThreads()
Me.tmrBackgroundWorker.Enabled = False
Me.tmrBackgroundWorker2.Enabled = False
If Not IsNothing(Me.dataBackgroundWorker) Then
If dataBackgroundWorker.IsBusy Then
Me.dataBackgroundWorker.CancelAsync()
While dataBackgroundWorker.IsBusy
Application.DoEvents()
Me.dataBackgroundWorker.CancelAsync()
End While
Me.dataBackgroundWorker.Dispose()
End If
End If
If Not IsNothing(Me.dataBackgroundWorker2) Then
If dataBackgroundWorker2.IsBusy Then
Me.dataBackgroundWorker2.CancelAsync()
While dataBackgroundWorker2.IsBusy
Application.DoEvents()
Me.dataBackgroundWorker2.CancelAsync()
End While
Me.dataBackgroundWorker2.Dispose()
End If
End If
End Sub