3

I am using following code to enable my text box to write in Urdu but it is typing in English as usual. Please advise what do I need to make my textobx, take urdu as input

Thanks

Dim x As New System.Globalization.CultureInfo("ur-PK")
    InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(x)
Csharp
  • 2,916
  • 16
  • 50
  • 77
Furqan Sehgal
  • 4,917
  • 33
  • 108
  • 167

2 Answers2

1

After I added Urdu as a language option in Windows your code snippet started to work.

Philip Fourie
  • 111,587
  • 10
  • 63
  • 83
0

you should use this for better result InputLanguage.CurrentInputLanguage = InputLanguage.InstalledInputLanguages(1) for Urdu use 1, for different languages use 2,3,4 and so on this work on textBox gotFocus event LIKE:

Private Sub TextBox1_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.GotFocus
        InputLanguage.CurrentInputLanguage = InputLanguage.InstalledInputLanguages(1)
End Sub