M
Marc Robitaille
Hello,
I think it is a easy question but I don't have any clue how to do it...Is it
possible to replace the char that a user type in a textbox with an other one
in the OnKeyPress methode? My textbox support 4 numbers types:
1-Integer
2-Decimal
3-Currency
4-Percent
I made a property with an Enum to support that. When the property NumberType
is set to 2, 3 or 4, I want the textbox to make no difference between the
"," and the "."
If the regional setting is set to "," and the user type "." I want my
textbox to change to the "," char. I validate this in the OnKeyPress methode
but I endup with the "." in the Textbox. I do something like this in the
OnKeyPress methode when NumberType is set to 2.
e = New
KeyPressEventArgs(convert.tochar(system.Globalization.NumberFormatInfo.CurrentInfo.NumberDecimalSeparator
))
I know that this is not the right solution because it's not working.
I need help
Thank you
I think it is a easy question but I don't have any clue how to do it...Is it
possible to replace the char that a user type in a textbox with an other one
in the OnKeyPress methode? My textbox support 4 numbers types:
1-Integer
2-Decimal
3-Currency
4-Percent
I made a property with an Enum to support that. When the property NumberType
is set to 2, 3 or 4, I want the textbox to make no difference between the
"," and the "."
If the regional setting is set to "," and the user type "." I want my
textbox to change to the "," char. I validate this in the OnKeyPress methode
but I endup with the "." in the Textbox. I do something like this in the
OnKeyPress methode when NumberType is set to 2.
e = New
KeyPressEventArgs(convert.tochar(system.Globalization.NumberFormatInfo.CurrentInfo.NumberDecimalSeparator
))
I know that this is not the right solution because it's not working.
I need help
Thank you