Thanks for the link. The AddProgress event is working, but I am unable to cancel the operation.
I tried both of these handlers seperately:
'AddHandler Zip.AddProgress, New EventHandler(Of AddProgressEventArgs)(AddressOf Zip_AddProgress) AddHandler Zip.AddProgress, AddressOf Zip_AddProgress
Private Sub Zip_AddProgress(ByVal sender As Object, ByVal e As AddProgressEventArgs)
If bwBackup.CancellationPending Then e.Cancel = True 'If we press the stop button, invoke Cancel. RunWorkerCompleted will be called. MsgBox("hi")
Select Case e.EventType Case ZipProgressEventType.Adding_Started 'code removed; update status label here. Exit Select Case ZipProgressEventType.Adding_AfterAddEntry 'code removed; update status label here. 'e.Cancel = True Exit Select End Select
The labels update as expected, and the message box fires constantly, as I would expect it to. However, e.Cancel is not working. Bypassing the background worker and directly cancelling the operation in Adding_AfterAddEntry (now commented out), did not work either. The operation continues until the SaveProgress phase, where it is cancelled immediately due to the previous call to bwBackup.CancelAsync.