0

Guys I want to know to skip error massages like the JIT error messages during run-time.
What I want in the program is that instead of the JIT popping out whenever an error occurs, I want to generate a msgbox instead of that JIT. Can anyone please help me,

thanks...

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Oxiegen
0

Enclose your code in a Try...Catch statement.

Private Sub aMethod()
   Try
      'Your code goes here
   Catch ex As Exception
      MessageBox.Show(ex.Message, "An error has occured")
   End Try
End Sub
0

This thread has been solved. Thanks guys, just a thought 'coze I have been doing this before, the Try...catch...End Try block but it wasn't working. Or was it because instead of the MessageBox.Show I was using the msgbox class?

0

MsgBox is the old VB style way. To use it you need to reference the legacy libraries.
MessageBox is the .NET way.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.