Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to stop when the field length is reached
Message
De
10/07/2002 16:20:23
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00676137
Message ID:
00677249
Vues:
19
>>>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...
>
>I added a new class property StopNow. In InteractiveChange I put this code:
>
>
>if len(alltrim(this.text))>=this.maxlength
>		this.StopNow = .t.
>		nodefault
>endif
>
>In KeyPress:
>lparameters nKeyCode, nShiftAltCtrl
>if this.maxlength > 0
>	if between(m.nKeyCode,9,13) && Tab or Enter
>	   this.StopNow = .f.
>	endif
>endif
>
>And in LostFocus
>if this.StopNow
>   nodefault && Don't loose focus
>endif
>
>This seems to fix the problem. Do you have better idea?

Yes, you might change between() for inlist() <g>.

Hilmar.
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