Handling Exceptions

  • Thread starter Thread starter Alex Glass
  • Start date Start date
A

Alex Glass

Module Init
Public Sub Main()
Try
Application.Run(New AccountsForm)
Catch ex As Exception
MsgBox("The application has experienced a critical error and now must
terminate!", MsgBoxStyle.Critical)
LogException(ex)
End Try
End Sub
End Module

----------------------------------------------------------------------------
---------------------------------------

When an exeception fires inside of the accounts form a window pops up that
asks me if i want to continue or quit the application. How do I prevent
this window with the exception info from appearing?

-Alex GLass
 
Alex Glass said:
Module Init
Public Sub Main()
Try
Application.Run(New AccountsForm)
Catch ex As Exception
MsgBox("The application has experienced a critical error and now must
terminate!", MsgBoxStyle.Critical)
LogException(ex)
End Try
End Sub
End Module

-------------------------------------------------------------------------- --
---------------------------------------

When an exeception fires inside of the accounts form a window pops up that
asks me if i want to continue or quit the application. How do I prevent
this window with the exception info from appearing?

-Alex GLass

Look up the Application.ThreadException event in the help files. Adding your
own custom handler for this event should prevent the display of the default
Windows Forms exception message box.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top