how to control textbox type to double in visual basic?

Posted by fema on Stack Overflow See other posts from Stack Overflow or by fema
Published on 2010-05-23T18:35:24Z Indexed on 2010/05/23 18:40 UTC
Read the original article Hit count: 208

Filed under:
|
|
|

Hi,

I'd like to make a textbox that accepts only numbers, but not integer, but rather double.
I've read here about e.Handled = Not Char.IsDigit(e.KeyChar) and it works, but again, it can be used only for integer, since it declines decimal point.
Another thing I've read here is If Not Double.TryParse(TextBox2.Text, value) Then .... and it would work fine, except that it allows only decimal comma instead of point. I don't know whether it's because of my location settings (Hungary, we use commas instead of points), but I don't have any other idea how to solve my problem, and the SQL server I send my data uses decimal point.

Thanks in advance.

© Stack Overflow or respective owner

Related posts about .NET

Related posts about vb.net