在vb.net Windows應用程序中,我需要用戶在關閉應用程序之前進行確認。我在FormClosing
情況下,本代碼通過用戶選擇取消表單關閉
If BackgroundWorker1.IsBusy Then
Dim UserSelection As Integer = MsgBox("Do you want Cancel Processing and Exit Application?", MsgBoxStyle.Exclamation + MsgBoxStyle.YesNo, "Exit Application")
If UserSelection = 6 Then
BackgroundWorker1.CancelAsync()
e.Cancel = True
Else
????
End If
End If
我怎樣才能取消形式結束,如果用戶點擊No
?
嘗試e.Cancel = false
但它沒有工作(退出應用程序)。
'e.Cancel = True'會停止表單關閉。 – keyboardP 2012-01-11 04:58:54
@keyboardP謝謝..我錯誤地把其他的方式,對我的愚蠢...抱歉... :) – Nalaka526 2012-01-11 05:01:01
不客氣! – keyboardP 2012-01-11 05:01:29