I still don't understand what you are trying to do ... Are you trying to stop a person from hitting the ESC key and exiting a form? I don't think it works that way .. but, you can grab the value in queryclose and keep the form open, if you simply want to know if the user pressed the esc key, you should be able to return the value from the KeyDown event, but it is pretty funny and I don't trust it