获得当前输入语言而无需关注 [英] get current input language without focus

查看:156
本文介绍了获得当前输入语言而无需关注的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在获取当前语言时遇到问题。



我知道如何得到并设置它,但我有一个计时器,每1秒获得语言自动但它有一个问题!



当我专注于表单计时器将获得真实值(英语),但如果我不专注于表格并将我的输入语言改为波斯语(例如)它将无法获得真正的价值,在我专注于表格之前它仍然是英语!



这是我正在使用的代码:



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:

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





我该怎么办?



谢谢



What should I do?

Thanks

推荐答案

您好,



以下是与您类似的StackOverflow问题的链接。我测试了它并且它的工作原理:



[ ^ ]



我希望它可以帮到你。
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.


这篇关于获得当前输入语言而无需关注的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆