Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INPUTMASK not behaving for text box

Status
Not open for further replies.

roselover

Programmer
Mar 27, 2003
11
0
0
US
I have a textbox in a form with the inputmask property set to a variable containing a mask. I have the property defined in the 'properties' box. It works fine when the user initially enters the form.

This inputmask can change to a date, depending on an option button.

If the user opts to switch back to the original inputmask and I reassign it with

Code:
thisform.txtbox.inputmask = mparmask

it doesn't work, although I can see that it picks up the code when I step through, and the variable contains the correct mask. It just shows my number, with no formatting at all.
 
Where do you define mparmask? Is it public? Sounds to me like it's going out of scope.

Regards,

Mike
 
Just tried it in VFP 6.0 - 9.0 and it worked fine in any version. Which property is it you have defined and what is the definition? Also, what exactly contains "mparmask"?

Volker/
 
mparmask is defined as public in the calling program. And when I 'step' through it, I can see it has the value of the variable in it.
Thanks
 
VolkeStamme -
I'm working in 6.0. It's the inputmask property of the text box (hope I'm understanding your question correctly - maybe I'm confused on the definition of 'defined'!)

The mask is '99-99-999-999'. Again, it works fine when the form first loads, using what I've entered in the InputMask for the text box (via the Foxpro interface). But when the inputmask, in code, gets changed to date (which works) and then back in code, (in the 'click' event of my option box), my number shows unformatted.
 
I'm assuming that your event fires as expected (i.e. you can hear a ??chr(7) in your code). You could try to toggle the format propery to "R" and back to normal but that's just a shot in the dark...

Volker/
 
It fires fine. I give up on this. I'm just going to throw another text box on top and make it visible/invisible based on the user's option. Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top