Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cancelling when in Valid Event
Message
De
14/07/1997 17:02:01
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00039722
Message ID:
00039903
Vues:
36
basically it is cool but note that this will also let the user move to the next control (by TAB) if the mouse over the CANCEL button Arnon > There was an article "PEM for your base classes" by Doug Hennig in > February's FoxTalk. with the solution for this problem. > The general idea is in using of sys(1270) which points to object under the > mouse cursor. The code in Valid method from that article: >
> * 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 >
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform