.net - How to stop TypeValidationCompleted event? -
had included 1 masktext box date.
in mask text boxes typevalidationcompleted code...
if (not e.isvalidinput) msgbox("the data supplied must valid date.", msgboxstyle.critical, "date error") tdatemask.text = "" tdatemask.focus() end if
now when try exit form pressing close button of form event occurring.
question "how stop event while try exit form?"
you can set flag , when validationcompleted event kicks off check flag, if set true (meaning form closing) can have ignore check.
ex: _formclosing global boolean set true during form closing event.
if (not e.isvalidinput) , (not _formclosing) msgbox("the data supplied must valid date.", msgboxstyle.critical, "date error") tdatemask.text = "" tdatemask.focus() end if
Comments
Post a Comment