Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MaxLength TextBox Property
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00084737
Message ID:
00084784
Vues:
29
>>In VFP 5, I am trying to take advantage of the MaxLength property in a textbox subclass. I have tried the following code:
>>This.MaxLength = ;
>>  iif(!empty[This.ControlSource], fsize[This.ControlSource], 0)
>>Anyone have any luck with this?
>>
>>TIA.
>
>Mark,
>
>MaxLength will do exactly what you are asking.
>
>Where did you put that code? I would place it in the Init of the control. Actually I would put it in a custom method named something like SetMaxLength and call that from the Init. Thatw ay if I ever changed the ControlSource at runtime I just have to call the SetMaxLength method.

That is what I am doing, but when I try it, the length seems to be font-specific (I am using Aerial). For example, for a 40 character field, it does not terminate until about character 46.
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform