Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i am using tow text boxes one is engslih language and other is thai language it is installed in my computer i use these bellow code please see

VB
Public Class Form1
    'Constant for english language

    Private Const _ENGLISH As String = "ENGL"

    'Constant for thai language

    Private Const _THAI As String = "THAI"


'A Temporary variable to hold the color of a control

VB
Private OriginalColor As Color
    Private Sub TextBox2_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox2.GotFocus, TextBox1.GotFocus

'===========================================================================

' FIRST PART - LANGUAGE(SWITCHING)

'===========================================================================

'We'll use the case statement to inspect the sender objects .Tag property

Select Case sender.Tag

VB
Case _THAI
                'If the Tag contains the word "THAI"

                'Loop through all the installed languages on this System

                For Each Lng As InputLanguage In InputLanguage.InstalledInputLanguages

                    'If there exists a language whose DisplayName has got the 

                    'word "THAI" in it

                    If Lng.Culture.DisplayName.ToUpper.StartsWith(_THAI) Or Lng.Culture.DisplayName.ToUpper.StartsWith("CATA") Then

                        'Change current input language to that 

                        InputLanguage.CurrentInputLanguage = Lng

                        'Exit for - coz we have found our language and no need to 

                        'go through the rest of the loop

                        Exit For

                    End If

                Next

            Case _ENGLISH           'If the Tag contains the word "ENGL"

                'Loop through all the installed languages on this System

                For Each Lng As InputLanguage In InputLanguage.InstalledInputLanguages

                    'If there exists a language whose DisplayName has got the 

                    'word "ENGL" in it

                    If Lng.Culture.DisplayName.ToUpper.StartsWith(_ENGLISH) Then

                        'Change current input language to that 

                        InputLanguage.CurrentInputLanguage = Lng

                        'Exit for - coz we have found our language and no need to 

                        'go through the rest of the loop

                        Exit For

                    End If

                Next

        End Select
    End Sub
End Class



i use it but it can not changes language please tell me how i can use these setting
when i write one text box so it should me in English and when i go in second text-box so it write Thai please help me
Posted
Updated 30-Jan-12 8:00am
v2

1 solution

 
Share this answer
 
v2
Comments
irfanansari 30-Jan-12 14:09pm    
IN THIS AUTO LANGUAGE WILL BE CHANGE I WANT TO JUST ONE TEXT-BOX SHOULD BE CHANGE LANGUAGE WHEN IT GETTING FOCUS
theanil 30-Jan-12 14:26pm    
i have updated my answer check it.
Anuja Pawar Indore 31-Jan-12 6:09am    
Don't use full caps........

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900