Information générale
Catégorie:
Codage, syntaxe et commandes
>I have a textbox where a pricecode can be entered, or a commandbutton can be used to bring up a form for pricecode selection.
>
>When I am in textbox and press the button, I do not want to run the validation routine for the textbox.
>
>I know I can detect if the mouse is over the button and return .T., but if you just happen to be sitting over the button, a bad code could be keyed.
>
>Any guidance would be appreciated.
I have a Form property (.L_Picking) that I toggle and test for in .Valid to handle cases like this; eg. If .L_Picking = .T., bypass the validation.
If you always subclass your controls and "delegate" logic like .When and .Valid to "virtual" events like .My_When and My_Valid, then it is simple to add extra logic like this; ie. it allows you to create your own "default logic" that executes "before" any other custom logic without having the custom logic explicitly call any default/special behaviour in the parent class.
I also have another flag (.L_Focusing) that handles programmed changes in Focus where a .Valid might kick in when it is not appropriate.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement