Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set InputMask programatically
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00392851
Message ID:
00392859
Views:
11
>I want to set the InputMask (XXXX) for a textbox at runtime using another object property to determine the length (nNumber) of the mask. I have tried putting "REPLICATE('X',nNumber) directly onto the properties InputMask line and also into the expression builder. Both generate errors. How can I do this so that the user is only permitted to enter nNumber of characters of the 'X' lind?
>
>Thanks.

You say you want to do it at run-time? Try adding something like this to the InteractiveChnage, Valid or LostFocus of the controlling control:

THISFORM.TextboxWhatever.InputMask = replicate("X",lenc(alltrim(THIS.Value)))

or possibly adding the eval() function around the replicate if it references the other control. The problem with this is you may get an error during instantiation if the controlling control doesn't exist when the textbox instatiates. The eval() will fail.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform