Results 1 to 3 of 3

Thread: [RESOLVED] [2005] How to change the Current Language

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Posts
    224

    Resolved [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

  2. #2
    Frenzied Member
    Join Date
    Mar 2005
    Location
    Sector 001
    Posts
    1,577

    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:
    1. Private Sub TextBox1_GotFocus
    2.  
    3.         InputLanguage.CurrentInputLanguage = InputLanguage.InstalledInputLanguages(0)
    4.     End Sub
    5.  
    6.     Private Sub TextBox2_GotFocus
    7.  
    8.         InputLanguage.CurrentInputLanguage = InputLanguage.InstalledInputLanguages(1)
    9.     End Sub
    To check what number each language is, something like that should work:
    VB Code:
    1. Dim InstalledLanguages As String
    2.         Dim lngNumber As Integer = 0
    3.  
    4.       Dim Language As InputLanguage
    5.  
    6.         For Each Language In InputLanguage.InstalledInputLanguages
    7.            InstalledLanguages &= lngNumber & ". " & Language.Culture.EnglishName & Environment.NewLine
    8.               lngNumber = lngNumber + 1
    9.        Next Language
    10.  
    11.       MessageBox.Show(InstalledLanguages)
    VB 2005, Win Xp Pro sp2

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Posts
    224

    Re: [2005] How to change the Current Language

    Hi,

    Thank you, your answer is excellent.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width