Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detecting trailing spaces in textbox control
Message
De
30/03/2001 08:43:53
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00489758
Message ID:
00490288
Vues:
12
Hi Jill,

I have an idea which may work. In the GotFocus event of the textbox, say:

this.value=repl(chr(10),17)
=insm(.f.)

In the KeyPress event, say:

if nkeycode=7 or nkeycode=127
this.value=trim(this.value)+chr(10)
endif

In the Valid event, say:

=insm(.t.)

I am using a double-byte character version of VFP6 and chr(10) works. In Enlish verson, chr(10) may not work, in which case you may have to use a different character which is not visible and is not expected to be keyed in. The textbox's SelectOnEntry should be set to .f.

BTW, the length of value (17) is dependent on the lenth of the textbox and its font size, unless the MaxLength is given.

CY
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform