Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to stop when the field length is reached
Message
 
 
À
08/07/2002 12:52:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00676137
Message ID:
00677220
Vues:
18
>< snip >
>>If doesn't seem to work. For instance, I have a textbox with controlsource BldMstr.Page (it's an integer field). I set MaxLength to 2 (for testing sake), but it still allows me to type 7 digits.
>>
>>I tried the following code in textbox InteractiveChange:
>>
>>if len(alltrim(this.text))>this.MaxLength
>>   nodefault
>>endif
>>
>>But it doesn't work either.
>>
>>What else can I do? May be set confirm ON in interactive change? (Back to off in GotFocus)?
>
>From VFP help:
>MaxLength only applies for a text box when MaxLength is greater than 0, the text box does not use the InputMask property, and its Value property is of character type.
>
>Checking on Keypress event? InputMask?

Ok, just found, that my solution doesn't work.

If anyone knows, how to solve this problem?

BTW, another strange thing I noticed: if I paste some text in the field (Ctrl+V), the KeyPress of this field is no longer firing even if I try to change some letters...
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform