Shawn said:
I have a form with a ton of fields to fill by the user. The entries
must fit certain criteria and that is checked during runtime. If an
entry fails a criteria the code should end and tell the user why it
stopped.
All perfectly reasonable and there are /many/ ways to accomplish it,
practically /none/ of which involve closing the Form.
However I do not want the form to unload.
It won't; unless you tell it to.
Or ...
.... if you allow an Unhanded Exception to propagate out of your code,
causing the entire application to crash and burn.
Don't let that happen.
Anywhere the user can initiate an action (loading the form, clicking a
button, etc., etc.), you should have at least one Exception handler
(Catch block) so that there are [hopefully] /no/ unhandled Exceptions.
That way, you can deal with (i.e. handle) anything that goes wrong
unless, of course, it goes /so/ far wrong that there's probably nothing
you can do about it anyway, like an Out of Memory error.
If you make a mistake typing in Word, Word does not close,
it shows you the spelling error.
Now, now. Don't go giving Our Friends in Redmond ideas ...
They forced us to adopt "The Ribbon". Why shouldn't they insist that we
never make a single spelling miztake? ;-)
HTH,
Phill W.