谁能在vb.net wpf格式的文本框中写下乌尔都语

时间:2015-06-02 12:07:52

标签: sql wpf vb.net

谁在vb.net wpf表单中的文本框中写下乌尔都语我在下面的代码中尝试这个但是下划线发生了 我做错了什么?  "引用非共享成员InputLanguageManager.CurrentInputLanguage"

Private Sub urdu_GotFocus(sender As Object, e As TextChangedEventArgs) Handles urdu.GotFocus
    InputLanguageManager.CurrentInputLanguage = InputLanguageManager.InstalledInputLanguages(2)
    Dim variable As String = urdu.Text
End Sub

1 个答案:

答案 0 :(得分:0)

假设您的系统上已经安装了Urdu。你可以尝试这样:

Public Sub urdu_GotFocus(ByVal InputLang As InputLanguage)
   If InputLanguage.InstalledInputLanguages.IndexOf(InputLang) = -1 Then
        Throw New ArgumentOutOfRangeException()
   End If
    InputLanguage.CurrentInputLanguage = InputLang
End Sub

请注意,System.Windows.Forms命名空间和System.Windows.Forms.dll程序集中存在InputLanguage

您也可以参考MSDN博客Changing the input language in a textbox at runtime