I have one pet peeve with the Textbox Validating Event and wanted to see if anybody knew a work around.
I have a textbox where the validating event forces the user to enter a positive number. If they do not, it opens a messagebox telling them to enter a positive number, sets the focus back to the textbox, and selects the text.
Now say somebody enters a negative number, get the message box, and decides that they need to check on the value and in the meantime will do something else in the app. However, when they click the Cancel button on the form the validation event still fires, and they need to enter a valid value before they can cancel.
Wouldn't it make sense for Validating event to not function if the user clicks the CancelButton of the form?
I usually use custom validating that functions when a user tries to click on OK button for example, but in this one instance the Validating event would work better.
Thanks.