M
Mark Lewis
I have a weird error trapping problem. When running the IDE everything works
fine but not when running in an EXE I get the Unhandled Exception Error
message box intead of the one in my Try....Catch Block.
To see this create a simple application with two forms. Form 1 should have
one button. The code is follows. Run this in the IDE and observe the error
and then compare that behavior to what happens when you run the built EXE.
Has anyone seen this?
Thanks,
Mark
===============================================
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim f As New Form2
Try
f.Show()
Catch ex As Exception
MessageBox.Show(ex.Message)
f.Dispose()
End Try
End Sub
End Class
Public Class Form2
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Throw New ApplicationException("error thrown in form2 load")
End Sub
End Class
fine but not when running in an EXE I get the Unhandled Exception Error
message box intead of the one in my Try....Catch Block.
To see this create a simple application with two forms. Form 1 should have
one button. The code is follows. Run this in the IDE and observe the error
and then compare that behavior to what happens when you run the built EXE.
Has anyone seen this?
Thanks,
Mark
===============================================
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim f As New Form2
Try
f.Show()
Catch ex As Exception
MessageBox.Show(ex.Message)
f.Dispose()
End Try
End Sub
End Class
Public Class Form2
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Throw New ApplicationException("error thrown in form2 load")
End Sub
End Class