[RESOLVED] [2005] How to change the Current Language
Hi,
I am using Visual Basic 2005 Express Edition
I have in the computer 6 languages that I can choose with the help of alt + shift
How can I change the language with "InputLanguage" ?
Example:
The curser is at Textbox1 then the language must be xxx
The curser is at Textbox2 then the language must be yyy
The curser is at Textbox3 then the language must be zzz
Thanks in advance
Re: [2005] How to change the Current Language
There is an array that holds representations of all the installed languages. You can use it together with the gotfocus event:
VB Code:
Private Sub TextBox1_GotFocus
InputLanguage.CurrentInputLanguage = InputLanguage.InstalledInputLanguages(0)
End Sub
Private Sub TextBox2_GotFocus
InputLanguage.CurrentInputLanguage = InputLanguage.InstalledInputLanguages(1)
End Sub
To check what number each language is, something like that should work:
VB Code:
Dim InstalledLanguages As String
Dim lngNumber As Integer = 0
Dim Language As InputLanguage
For Each Language In InputLanguage.InstalledInputLanguages
InstalledLanguages &= lngNumber & ". " & Language.Culture.EnglishName & Environment.NewLine
lngNumber = lngNumber + 1
Next Language
MessageBox.Show(InstalledLanguages)
Re: [2005] How to change the Current Language
Hi,
Thank you, your answer is excellent.