Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Textbox readonly problem
Message
De
01/04/2004 08:09:41
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
31/03/2004 10:05:30
Alan Harris-Reid
Baseline Data Services
Devon, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00891159
Message ID:
00891443
Vues:
22
May I suggest a different validation strategy. Postpone everything until the record is saved. The user can write any garbage he likes into the TextBoxes, etc., go back, correct it, without any error messages. As soon as he tries to save, he sees a list of rules violated.

This is much simpler to program. Also, it is more flexible for the end-user.

>In my foundation textbox class, if I want to prevent a user changing the value I prefer to make it readonly rather than disabled. The main reason for this is that if the current value is too long for the visible area of the control, the user can still press the right-arrow or end-key to see the full contents (or press Ctrl+c for copying). The downside of this approach is that pressing enter or tab to exit field fires the valid event, often running unnecessary code and sometimes having undesired effects.
>
>One way round this problem is to check for this.readonly=.F. before running validation code, but this would be a pain for every valid event (or lostfocus, come to think of it) which has code.
>
>Apart from making the control disabled instead of readonly, is there any other way around this problem? BTW, I am using VFP7.
>
>Any help would be appreciated.
>
>Alan
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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform