473,473 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

Similar topics

3
by: Simon Whale | last post by:
Hi, is there a way within vb,net to specify the way that information is entered into a textbox? for example a field that requires data to be inputted as DD/MM/YYYY i know this was possible...
1
by: Suresh | last post by:
Hi All, Iam looking for the following 1)What needs to be done so that user can enter only numeric values in the TextBox? 2)How to set Mask for TextBox component. For example, if a TextBox is...
9
by: msnews.microsoft.com | last post by:
Hello. How can I set input mask for TextBox? Or can I use for mask input some other control?
0
by: Christian | last post by:
Hi all, on a PocketPC 2003 dialog I want the user to enter an IP-Adress using a TextBox control. Within the TextBox control I would like to display an predefined input mask like xxx.xxx.xxx.xxx ...
2
by: Alberto | last post by:
Can I set a mask to a TextBox? How? Thank you very much
2
by: Mervin Williams | last post by:
I am trying to set the text property of one of my labels in a data grid to the value of a text box in the same datagrid. Please help! Mervin Williams
5
by: msnews.microsoft.com | last post by:
Hello. How can I set input mask for TextBox in Windows Form? For example I want to mask (format) TextBox for inputing phone number like (999) 999-99-99. The TextBox must first show something like...
3
by: Aaron Smith | last post by:
I found an quick and dirty example of a numeric text box that converts the string to a currency mask.. Here is the code: Public Class NumericMaskedTextBox Inherits System.Windows.Forms.TextBox ...
7
by: DazedAndConfused | last post by:
Curently I manualy code keypress edits. i.e. allow only 3 digits before decimal and two digits after decimal in .NET. Is there an easy solution to mask text boxes? The MSMASK32.OCX from vb6...
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
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...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.