escheider
asked on
Masked Edit Box
Hello experts:
I'm working with a masked edit box and I'm getting stumped on what should be something simple.
I have a masked edit box with the mask set to (###)###-####
This is used to capture a phone number. However, if I'm navigating through records, I can't figure a way to clear out the phone field because it won't accept blanks.
Would someone offer some assistance on how to clear out this field?
Thanks
I'm working with a masked edit box and I'm getting stumped on what should be something simple.
I have a masked edit box with the mask set to (###)###-####
This is used to capture a phone number. However, if I'm navigating through records, I can't figure a way to clear out the phone field because it won't accept blanks.
Would someone offer some assistance on how to clear out this field?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
There is anohter way
If your mask property in the masked edit is like this
"#####", in the code to clean this masked edit box you have to use
maskededit.text = "_____"
This, if the promptchar property is "_"
so the only thing that you have to do is to replace the text with the "empty mask" with only prompt chars.
For example
Maskededitbox.mask = "(###)-##-##-##-##"
Maskededitbox.promptchar = "_"
to clean the maskededit box you only have to put this code
maskededitbox.text = "(___)-__-__-__-__"
and the maskededitbox will be cleaned
If your mask property in the masked edit is like this
"#####", in the code to clean this masked edit box you have to use
maskededit.text = "_____"
This, if the promptchar property is "_"
so the only thing that you have to do is to replace the text with the "empty mask" with only prompt chars.
For example
Maskededitbox.mask = "(###)-##-##-##-##"
Maskededitbox.promptchar = "_"
to clean the maskededit box you only have to put this code
maskededitbox.text = "(___)-__-__-__-__"
and the maskededitbox will be cleaned
ASKER