I have a MaskedTextBox with this mask (999) 999 9999. When user inputs a number the text property would give this to me :
(0881) 444 5445
B
It's Work for me
Just Change Property Value
Try setting the maskedTextBox.TextMaskFormat
property to
MaskFormat.ExcludePromptAndLiterals
Based on what I found here you can set the TextMaskFormat
-Property to MaskFormat.ExcludePromptAndLiterals
. That should be you solution.
The MaskFormat
-Enumeration holds some "options" for the MaskedTextBox.
They are:
ExcludePromptAndLiterals
Return only text input by the user.IncludeLiterals
Return text input by the user as well as any literal characters defined in the mask.IncludePrompt
Return text input by the user as well as any instances of the prompt character.IncludePromptAndLiterals
Return text input by the user as well as any literal characters defined in the mask and any instances of the prompt character.The default is
IncludeLiterals