' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Public Partial Class MainForm
        Public Sub New()
            InitializeComponent()
            AddHandler AppDomain.CurrentDomain.UnhandledException, AddressOf Sorry
        End Sub
        Private Sub Sorry(sender As Object, e As UnhandledExceptionEventArgs)
            MessageBox.Show("Sorry - we have a problem - we will close app now")
            Application.Exit()
            Environment.Exit(1)
        End Sub
        Private Sub Button1Click(sender As Object, e As EventArgs)
            Dim a As Integer = 0
            Dim b As Integer = 0
            Dim c As Integer = a \ b
        End Sub
End Class
