Tariq,
Do you have a "cancel" button on the form? If so just set it's Cancel property = .t. otherwise add one.
Can you explain in more detail under what conditions you'd be "simulating" the ESC keypress programatically? There may be a much better way to do what you want.
>For some reasons I want to close Form with ESC key and do not want to press ESC key mannually. I want to press ESC key programatically.
>
>Please help again