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...

Recommended Answers

All 3 Replies

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

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?

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.