-3

I make Program check language

Dim ln As String

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick

 ln = System.Windows.Forms.InputLanguage.CurrentInputLanguage.LayoutName

 If ln = "US" Then

 Label1.Text = "English"

 Else

 Label1.Text = "Thai"

 End If

 End Sub

My program will check windows language but this program will check language itself not check windows.

Sorry My English bad.

Please help me.

1 Answers1

2

According to http://msdn.microsoft.com/en-us/goglobal/bb688135.aspx, "Switching to a different input language is done on a per-thread basis; you can have two different input languages in two different applications." That's why you don't see changes made in Notepad - you're asking for the current thread's language, not Notepad's language.

Also, take a look at Detect system language change in WPF to see how to use events instead of polling with a timer.

Community
  • 1
  • 1
Darryl
  • 5,907
  • 1
  • 25
  • 36