> * Valid event code > local oObject > oObject = sys(1270) > if lastkey = 27 or (type('oObject') = 'O' and ; > type('oObject.lCancel') = 'L' and oObject.lCancel) > return .t. > endif > return this.Validation() >> Note that commandbutton class has the custom property lCancel which > determines is this button is used as Cancel button, and other classes have > custom Validation method which performs the validation itself. > > Sometimes I use just simplified version of this, without any custom methods > and properties: > >
> * Valid event code > local oObject > oObject = sys(1270) > if lastkey = 27 or oObject.name = "MyCancelButton" > return .t. > endif > * validation code here >> > HTH > > Nick >