Hi Jim!
Close button doesn't have an Inkey() value at all. But you can check the
click on that button in QueryUnload event:
nodefault
if thisform.Valdation()
=dodefault()
endif
and your window will close only after successful validation
* Beggars cannot be choosers
>On Valid method, I put the following code
>
>local oObject
>oObject = sys(1270) && object reference to the control the
>&& user just clicked on
>
>if lastkey() = 27 .or. (type("oObject") = "O" .and. ;
>type("oObject.lCancel") = "L" .and. ;
>oObject.lCancel)
>return .t.
>endif
>
>return this.Validation()
>
>If I know what the inkey value for Close Button X, I could avoid to
trigger
>the Validation() method. Any suggestions?
* Human is a question asked by birth and answered by death. Machine is another kind of question with another kind of answer