0

Hi I am having a requirement in my project where User press '.' in his num pad and he wants the character ',' to be displayed (dats bcoz he is French User).

I tried changing the e.KeyCode but it is a readonly property.

Is there any other way to change the key in key events? please let me know and it very important and would be great help for me now.

Thanks in Advance

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by mhs.praveen
0

Use next code:

Private Sub TextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox.KeyPress
        Dim ascii As Integer = Asc(e.KeyChar.ToString)
        
        ' Ascii code for comma is 46
        If ascii = 46 Then
            e.KeyChar = ","
        End If
    End Sub
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.