468,462 Members | 1,786 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,462 developers. It's quick & easy.

How textbox mask control?

for the textbox, how can i make the user only input the numeric value and
with decimal 2 ?
e.g 123.56 but not 123.567

Thanks
From Agnes
Nov 20 '05 #1
6 12436
* "Agnes" <ag***@dynamictech.com.hk> scripsit:
for the textbox, how can i make the user only input the numeric value and
with decimal 2 ?
e.g 123.56 but not 123.567


<URL:http://www.codeproject.com/cs/miscctrl/maskedcsedit.asp>
<URL:http://www.codeproject.com/vb/net/maskedbox_control.asp>
<URL:http://www.codeproject.com/vb/net/validtext3.asp>
<URL:http://www.codeproject.com/vb/net/cpflexmaskeditbox.asp>
<URL:http://www.codeproject.com/useritems/ValidText.asp>
....

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2
Hi,

In addition to Herfried's comments you can use a numericupdown
control with the decimalplaces set to 2.

Ken
-----------------
"Agnes" <ag***@dynamictech.com.hk> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
for the textbox, how can i make the user only input the numeric value and
with decimal 2 ?
e.g 123.56 but not 123.567

Thanks
From Agnes

Nov 20 '05 #3
A simple Regular Expression

Bismark

"Agnes" <ag***@dynamictech.com.hk> a écrit dans le message de
news:%2****************@TK2MSFTNGP10.phx.gbl...
for the textbox, how can i make the user only input the numeric value and
with decimal 2 ?
e.g 123.56 but not 123.567

Thanks
From Agnes

Nov 20 '05 #4
how about you provide an example of how a regular expression is going to
keep them entering characters in the correct format?
"Bismark Prods" <tr*******@vtxnet.ch> wrote in message
news:c7**********@newshispeed.ch...
A simple Regular Expression

Bismark

"Agnes" <ag***@dynamictech.com.hk> a écrit dans le message de
news:%2****************@TK2MSFTNGP10.phx.gbl...
for the textbox, how can i make the user only input the numeric value and
with decimal 2 ?
e.g 123.56 but not 123.567

Thanks
From Agnes


Nov 20 '05 #5
By validating the textbox every time a character is set or unset. It is the
proper of REGular EXPression isn't it ? Allowing only certain characters and
not matching the others. If not match he or she could be throwing a new
exception ...

It is my vision of this problem.

Bismark

P.S.: this could be like this ... \d'*\.\d{3}
"Brian Henry" <br**********@newsgroups.nospam> a écrit dans le message de
news:eU*************@TK2MSFTNGP10.phx.gbl...
how about you provide an example of how a regular expression is going to
keep them entering characters in the correct format?
"Bismark Prods" <tr*******@vtxnet.ch> wrote in message
news:c7**********@newshispeed.ch...
A simple Regular Expression

Bismark

"Agnes" <ag***@dynamictech.com.hk> a écrit dans le message de
news:%2****************@TK2MSFTNGP10.phx.gbl...
for the textbox, how can i make the user only input the numeric value and with decimal 2 ?
e.g 123.56 but not 123.567

Thanks
From Agnes



Nov 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Simon Whale | last post: by
1 post views Thread by Suresh | last post: by
9 posts views Thread by msnews.microsoft.com | last post: by
2 posts views Thread by Alberto | last post: by
2 posts views Thread by Mervin Williams | last post: by
5 posts views Thread by msnews.microsoft.com | last post: by
3 posts views Thread by Aaron Smith | last post: by
7 posts views Thread by DazedAndConfused | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.