We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

MaskedEditBox: how to get rid of prompt characters completely

Hello, I've been trying to use the MaskedEditBox to input C++ type names. This means only alphanumeric characters are allowed, as well as the '_' . Question #1. I'm not sure how to allow the '_' at the same time as alphanumeric. Question #2. I am not interested in seeing prompt characters at all, the thing is when I tab to that control, or double-click the control, I can see spaces that fill out the mask (if mask is of length 32, and the user entered a string of length 16, we can see the 16 remaining spaces). Is there anything that can be done to fix both of these problems? thanks, hugues

1 Reply

DJ Davis Jebaraj Syncfusion Team March 26, 2003 06:53 PM UTC

Hi, 1. To allow the _ character in addition to the alphanumeric characters you can handle the MaskCustomValidate event and specify this behavior by just setting the event argument's Handled and Accepted properties. Please see the attached sample. 2. To have no PromptCharacter : Set the PromptCharacter, PassivePromptCharacter and PaddingCharacter to be the null character(In code you can set the PromptCharacterInt, PassivePromptCharacterInt and PaddingCharacterInt to be 0) Please see the attached sample for this behavior also. Please let us know if you have any further questions. Regards, Davis

Live Chat Icon For mobile
Up arrow icon