diff --git a/ApplicationEvents.vb b/ApplicationEvents.vb new file mode 100644 index 0000000..a7757a2 --- /dev/null +++ b/ApplicationEvents.vb @@ -0,0 +1,20 @@ +Imports System.IO + +Namespace My + ' The following events are available for MyApplication: + ' Startup: Raised when the application starts, before the startup form is created. + ' Shutdown: Raised after all application forms are closed. This event is not raised if the application terminates abnormally. + ' UnhandledException: Raised if the application encounters an unhandled exception. + ' StartupNextInstance: Raised when launching a single-instance application and the application is already active. + ' NetworkAvailabilityChanged: Raised when the network connection is connected or disconnected. + Partial Friend Class MyApplication + Private Sub MyApplication_UnhandledException(sender As Object, + e As ApplicationServices.UnhandledExceptionEventArgs) Handles Me.UnhandledException + + + MessageBox.Show("An unexcpected error occured. Application will be terminated." & vbCrLf & e.Exception.Message) + End + + End Sub + End Class +End Namespace diff --git a/My Project/app.manifest b/My Project/app.manifest index 78115d7..b67fa4b 100644 --- a/My Project/app.manifest +++ b/My Project/app.manifest @@ -24,10 +24,16 @@ - - - - + + + + + + + + + + diff --git a/TestEIn.vbproj b/TestEIn.vbproj index ef35bff..e1608a1 100644 --- a/TestEIn.vbproj +++ b/TestEIn.vbproj @@ -46,9 +46,9 @@ x86 - None + none false - true + false true bin\Release32\ @@ -166,6 +166,7 @@ Form + Component.vb