473,385 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

MaskedTextBox and PromptChar

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
1 4887

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mauricio C Vidotto | last post by:
I have an application that use MaskedTextBox Control. This control has Mask property value 9999999.99 and I would like to add numeric values with 2 decimal places. However, if I set Text property...
0
by: dumbo | last post by:
I do not succeed to modify the content of a MaskedTextBox control whose Property "OutputText" is in binding with field of type text of one table in database a MDB. The control has been generated...
1
by: Matt | last post by:
I recently came across what I believe to be a peculiar bug with Mdi Children, and wanted to see if anyone else had experienced this before sending it in. The issue is as follows: I have a number...
2
by: Jaime Rios | last post by:
Hi, I'm using C# to create a printable form. The data is coming from a XML source that I load when the application starts. I have no problems loading the data, but I am having a hard time figuring...
1
by: Jazer | last post by:
Hi, I have a problem with MaskedtextBox. When I 'am trying to insert value 1.5 (single type) into MaskedTextBox, the value on it is shown as 15__,_. Mask is #90.9 The result should be ___1,5...
2
by: sklett | last post by:
Hi, I'm trying to define a mask for a MaskedTextBox and can't get it right. For 5 numbers, '00000' seems to be a valid mask and behaves correctly, but I know need a control that will take a...
1
by: Craig | last post by:
Hi, I have had a look on google groups for help on the MaskedTextBox and strings but every post I find seems to relate for formatting numbers. So, is it possible to set up a mask on the...
1
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
We have some dumb and lazy people here, so I need help. To fix the dumb part: We have placed MaskedTextBoxes on the forms so they will stop entering the information incorrectly. Now the lazy...
3
by: =?Utf-8?B?UGFvbG8=?= | last post by:
I have a maskedtextbox (msktxtbxAmount)defined thus: Mask $#####.## and msktxtbxAmount.ValidatingType = typeof(System.Decimal) with a PromptChar of =. I have defined: decimal transAmount and the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.