clean up
This commit is contained in:
19
EnvelopeGenerator.Form/ApplicationEvents.vb
Normal file
19
EnvelopeGenerator.Form/ApplicationEvents.vb
Normal file
@@ -0,0 +1,19 @@
|
||||
Imports Microsoft.VisualBasic.ApplicationServices
|
||||
|
||||
Namespace My
|
||||
' Für MyApplication sind folgende Ereignisse verfügbar:
|
||||
' Startup: Wird beim Starten der Anwendung noch vor dem Erstellen des Startformulars ausgelöst.
|
||||
' Shutdown: Wird nach dem Schließen aller Anwendungsformulare ausgelöst. Dieses Ereignis wird nicht ausgelöst, wenn die Anwendung mit einem Fehler beendet wird.
|
||||
' UnhandledException: Wird bei einem Ausnahmefehler ausgelöst.
|
||||
' StartupNextInstance: Wird beim Starten einer Einzelinstanzanwendung ausgelöst, wenn die Anwendung bereits aktiv ist.
|
||||
' NetworkAvailabilityChanged: Wird beim Herstellen oder Trennen der Netzwerkverbindung ausgelöst.
|
||||
Partial Friend Class MyApplication
|
||||
Protected Overrides Function OnUnhandledException(e As UnhandledExceptionEventArgs) As Boolean
|
||||
Dim oMessage = $"Unexpected Error occurred, Application will close.{vbNewLine}{vbNewLine}{e.Exception.Message}{vbNewLine}Stacktrace:{vbNewLine}{e.Exception.StackTrace}"
|
||||
MsgBox(oMessage, MsgBoxStyle.Critical, "EnvelopeCreator")
|
||||
|
||||
e.ExitApplication = True
|
||||
Return True
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
Reference in New Issue
Block a user