这是代码:
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If e.CloseReason = CloseReason.TaskManagerClosing Then
e.Cancel = True
IO.File.Create(Environment.CurrentDirectory & "\TEST.TXT").Dispose()
End If
End Sub
当我从任务管理器关闭它时,它不会触发任务管理器关闭的事件。