Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi,

I have a problem with getting current language.

I know how to get and set it but i have a timer which is getting language auto every 1 second but it has a problem!

When I focus on the form timer will get the true value(English) but if I not focus on the form and change my input language to persian(for example) it won't get the true value and it is still getting English until I focus on the form!

This is the code I am using:

VB
Dim myCurrentLanguage As InputLanguage = InputLanguage.CurrentInputLanguage
        Label6.Text = myCurrentLanguage.Culture.EnglishName & ControlChars.Cr


What should I do?

Thanks
Posted
Updated 17-Dec-14 22:42pm
v2
Comments
DamithSL 18-Dec-14 4:44am    
how you change input language? in which event you check language again?
Pouya Mozafar 18-Dec-14 4:46am    
I change language by shift + Alt(it changes).

i put the code in timer.

1 solution

Hi,

Below is link for StackOverflow question similar to yours. I tested it and it works:

http://stackoverflow.com/questions/26617159/hook-detect-windows-language-change-even-when-app-not-focused[^]

I hope it help you.
 
Share this answer
 
Comments
Pouya Mozafar 18-Dec-14 5:11am    
Thanks but that was C# code... Any VB.NET code you have?
Marcin Kozub 18-Dec-14 6:09am    
No, I don't have VB code, but you can try to convert C# to VB using this tool:
http://www.developerfusion.com/tools/convert/csharp-to-vb/

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