I like to assign a particualar value with not more 4 decimal points with the
textbox. How to assign it?

Please suggest!

Thanking you in advance,

David S.Noah

RE: Where is mask property for Textbox? by JCauble

JCauble
Tue Jan 10 09:08:09 CST 2006

If you are using 2.0 you can use the Masked edit control for this. In 1.1 /
1.0 you would normally need to implement the code to check for this in the
KeyPress / KeyDown events and cancel any key strokes that are not allowed.

Something like:

if txtBox.text.indexof(".") > 0 then
if txtBox.text.substring(txtBox.text.indexof("."),
txtBox.text.length).length > 4 then
cancel the event
else
let the textbox add the value
end
end



"David S. Noah" wrote:

> I like to assign a particualar value with not more 4 decimal points with the
> textbox. How to assign it?
>
> Please suggest!
>
> Thanking you in advance,
>
> David S.Noah

Re: Where is mask property for Textbox? by Stoitcho

Stoitcho
Tue Jan 10 10:21:45 CST 2006

David,

.NET 1.x WinForms doesn't have such a control. It has been added for .NET
2.0 version of the library, see MaskedTextBox class.

In .NET1.x VB (C# also I believe) programmers can use old active ActiveX
MaskEdBox from the MSMASK32.OCX.

There are some managed solutions out there you just need to google for them.
For example I found this one:
http://www.c-sharpcorner.com/Code/2003/March/MaskEditControl.asp


--
HTH
Stoitcho Goutsev (100)

"David S. Noah" <DavidSNoah@discussions.microsoft.com> wrote in message
news:5536F83B-C6C1-4CC0-ADA4-0ECEC9F23B88@microsoft.com...
>I like to assign a particualar value with not more 4 decimal points with
>the
> textbox. How to assign it?
>
> Please suggest!
>
> Thanking you in advance,
>
> David S.Noah