Error Trapping in a VB.NET program

  • Thread starter Thread starter Fred Nelson
  • Start date Start date
F

Fred Nelson

Hi:

This is a newby question!

I have written my first VB.NET windows application and I would like to have
a routine that is called if a run time error should occur anywhere in the
program. The docs that I have found only discuss the try & catch structure
which is not what I'm looking for.

Also the "on error goto" doesn't appear to be what I need either as its
required in each subroutine.

(In VB.NET web apps there is a way to do this.)

Is there a way to specify an error handler for an entire VB.NET program? I
would appreciate it if anyone could point me in the right direction.

Thanks,

Fred
 
Put an On Error Goto in sub Main(). This will catch all errrors that come
up. Also, make sure sub Main() stays in memory by showing your main form
MODAL.

Mike Ober.
 

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

Similar Threads

VB.net error trapping 1
Exceptions, VB.NET and INTEL Fortran 3
resume next in VB.NET ? 10
find trap address 1
start a program in a vb.net program 2
Importing binary Date (VB3) to VB.NET 1
vb.net exceptions 4
VB.net 12

Back
Top