Is it possible when throwing a custom exception to pause the program instead of just exiting?
I have a throw customexception("error msg") in my main and I want to print the error msg and then press return to exit or something like that.
@obscured47 You can do anything once you catch the exception.
Why do you want to throw an exception to pause the execution? There could be better ways to do that.
Can you post small segemt of your code and let us know the behaviour you are expecting ?
You need to catch the exception. You need to write a catch block. If you let OS to handle your first chance exception it is going to simply terminate the process because OS does not know which way you want to terminate.
You can try writing the catch block and exit from there.
>I want to throw the exception, the user will see the msg, press return and then terminate.
Set your own custom termination handler. Look in your reference for the <exception> header to get more details.
For Each ctrl As Control In Me.Controls("pnlMainPanel").Controls
If ctrl.GetType Is GetType(System.Windows.Forms.Panel) Then
For Each subCtrl As Control In ctrl.Controls
If subCtrl.GetType Is GetType(System.Windows.Forms.TextBox) Then
If subCtrl.GetType Is ...