How do strip the mask character out of the mask Text box text

  • Thread starter Thread starter grs
  • Start date Start date
G

grs

If you do a maskTextBox.String() the mask characters are still in the
string. Surely MS does not want you to store the masking characters - where
is the method to remove the masking characters.

grs
 
Hi grs,

Could you let me know what control is this? Is this a common TextBox in
windows form or in asp.net? As far as I know, the TextBox control doesn't
have the String() method. Also do you mean that you need to unmask the
character and show the plain text to the user?

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Hi grs,

Do you mean that you need to exclude the mask characters such as '-' when
you're trying to get the text using maskedTextBox.Text property? If so, you
just need to set the maskedTextBox.textMaskFormat to
MaskFormat.ExcludePromptAndLiterals.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Kevin,

Got it.
mtbZipCode.TextMaskFormat = MaskFormat.ExcludePromptAndLiterals;

thanks

grs
 
You're welcome.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top