closing the form using ESC button


I know that on clicking the esc button the form will call for close method  and if we write any validation in canclose and the form will not allow user to close the form until the validation gets filled as the canclose method will gets called first to close method.

So my question is,is there a way i can write the validation in canclose and user should be able to close the form using esc button eventhough  the validation in canclose method doesn't gets filled?Please let me know.


Thanks for your help!!!