Click to See Complete Forum and Search --> : Clear contents of a masked edit box


CSharpLearner
July 1st, 2004, 06:13 PM
Hi Gurus,

I had posted this a few days ago....

How do I clear the contents of a masked edit box (values that users have entered)?

Eg: When I click button "Reset", I need to clear out all text entered in the masked edit box and set the original mask to the box...

Help desperately needed....

Thanks in advance,

CSharpLearner

Andy Tacker
July 2nd, 2004, 07:47 AM
did you try simply setting the mask over again instead of reset?

if it is a custom text box control, you should have defined a function to clear input data.

if it is ordinary text box, you know the mask you are setting, simply remove whatever is unwanted.

CSharpLearner
July 2nd, 2004, 09:37 AM
Hi Andy,

I tried MaskedEdBox.Reset()
and MaskedEdBox.Mask = ##/##/####

Both did not work. I have added a AxMaskEd box and it is not a textbox customized to be a masked edit box.

The .CliPText and .FormattedText properties are not available for setting at runtime....

Can you help me further?

otaviomacedo
July 20th, 2004, 09:22 AM
Hi, CSharpLearner,

Try to use quotation marks, such as:

MaskedEdBox.Mask = "##/##/####"

CSharpLearner
July 21st, 2004, 01:31 PM
Hi all,

Yes, tried with quote marks as suggested, ie MaskedEdBox.Mask = "##/##/####" , but it does not work too!

Need some help desperately here....

Thanks in advance,

CSharpLearner

rlaffolter
September 23rd, 2004, 04:29 PM
ChipLearner:

Kind of puzzling.
The book I have says to do this:

mskControlName.Mask = ""
mskControlName.Text = ""
mskControlName.Mask = "##/##/####"

I tried it and it did NOT work.

Hope you find your answer if you haven't yet.

RA

chrisw99
October 1st, 2004, 04:21 PM
I figure that you found a solution already since it has been a couple of months since your last post. I wanted to post the solution anyways as other people will probably stumble onto this thread looking for an answer.

MaskEdit1.mask = ""
MaskEdit1.Ctltext = ""
MaskEdit1.mask = "##/##/####" 'Your original mask property

Happy coding!