Home All Groups Group Topic Archive Search About

Typed Dataset and Numeric Only Fields in VB.Net 2005 ?

Author
3 Apr 2006 12:36 PM
Luqman
My textbox is bound to Typed Dataset, with a Numeric Field, I want the user
should not type anything in textbox except Numeric, how can I ?
The data type is : Sql Server Decimal(5,2)

Currently, VB.Net automatically raise error on lost focus of textbox, but I
don't want user to type anything else except Numeric, any property to be set
in Textbox?



Best Regards,

Luqman

Author
3 Apr 2006 1:09 PM
Cor Ligthert [MVP]
Luqman,

Isnumeric(textbox.text) test on numeric,

Be aware that it takes every item that can be numeric in the
culture/language setting of a client.

For version 2005 is instead of the textbox for this the masked textbox,
however

http://msdn2.microsoft.com/en-us/library/system.windows.forms.maskedtextbox(VS.80).aspx

I hope this helps,

Cor

Show quoteHide quote
"Luqman" <pearls***@cyber.net.pk> schreef in bericht
news:%23ArQBrxVGHA.4724@TK2MSFTNGP09.phx.gbl...
> My textbox is bound to Typed Dataset, with a Numeric Field, I want the
> user
> should not type anything in textbox except Numeric, how can I ?
> The data type is : Sql Server Decimal(5,2)
>
> Currently, VB.Net automatically raise error on lost focus of textbox, but
> I
> don't want user to type anything else except Numeric, any property to be
> set
> in Textbox?
>
>
>
> Best Regards,
>
> Luqman
>
>