>hi,
>
>i want to close my form if i pressed "ESC" key,
>
>how do i do that?
One way is to have a button with a caption similar to "Close", and set the property "Cancel" to .T. Pressing ESC will activate the click event of the button.
If you don't want a special button, you can also use the Form.KeyPress() Event. You will also have to change Form.KeyPreview.
HTH,
Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)