By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,888 Members | 1,465 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,888 IT Pros & Developers. It's quick & easy.

MaskedTextBox and PromptChar

P: n/a
Hello,

I am trying to utilize a MaskedTextBox control on my form. I would
like the user to enter numbers only (i.e. 65000), I set the Mask
property as 999999 and the PromptChar as space (it won't take a
blank). However in my output the masked characters are replaced by
spaces. How can I change this promptchar to a blank/empty value so
that there are no spaces? Is there a more suitable control to use?

Thanks
Mike
Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"eljainc" <el*****@sbcglobal.netwrote in message
news:59**********************************@c65g2000 hsa.googlegroups.com...
Hello,

I am trying to utilize a MaskedTextBox control on my form. I would
like the user to enter numbers only (i.e. 65000), I set the Mask
property as 999999 and the PromptChar as space (it won't take a
blank). However in my output the masked characters are replaced by
spaces. How can I change this promptchar to a blank/empty value so
that there are no spaces? Is there a more suitable control to use?
You can't use the MaskedTextBox.Text.Trim() or some other string
manipulation method for the control? You can even make-up a method like a
String method named RemoveSpacesMTB( ref MaskedTextBox ctrl), give the
method the MaskedTextBox control, do string manipulation that way too off of
ctrl.text.whateverstringmethod(), and return the manipulated string to the
control.

Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.