On a form, by setting KeyPreview to Yes and using the KeyUp, KeyDown or KeyPress events, I can trap a user who presses the Escape key.
I do this so a user cannot avoid the form validations by pressing Escape when the record is dirty. I prompt for their intentions and either wipe out the entry or set the form back to dirty in the code, depending on their response.
However, in the case where they do not want to abandon their entry, and I set the form back to dirty, the Escape press has still wiped out any changes they've made to the record to that point.
Does anyone know how to stop the Escape key from working - either entirely or using code to ignore it? Or maybe to restore field values that have been undone by the Escape key?
Thanks very much.
Joe
I do this so a user cannot avoid the form validations by pressing Escape when the record is dirty. I prompt for their intentions and either wipe out the entry or set the form back to dirty in the code, depending on their response.
However, in the case where they do not want to abandon their entry, and I set the form back to dirty, the Escape press has still wiped out any changes they've made to the record to that point.
Does anyone know how to stop the Escape key from working - either entirely or using code to ignore it? Or maybe to restore field values that have been undone by the Escape key?
Thanks very much.
Joe