安装/添加新的输入语言到Windows [英] Install/add new input language to windows

查看:80
本文介绍了安装/添加新的输入语言到Windows的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi pals,
How can i add/install a new input language to windows via code.
 
I have been able to change the input language for my form using the code below:
 
System.Windows.Forms.InputLanguage original;
private void barButtonItem18_ItemClick_1(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
original = System.Windows.Forms.InputLanguage.CurrentInputLanguage;
var culture = System.Globalization.CultureInfo.GetCultureInfo("ar-SA");
var language = System.Windows.Forms.InputLanguage.FromCulture(culture);
if (System.Windows.Forms.InputLanguage.InstalledInputLanguages.IndexOf(language) >= 0)
System.Windows.Forms.InputLanguage.CurrentInputLanguage = language;
else
System.Windows.Forms.InputLanguage.CurrentInputLanguage = System.Windows.Forms.InputLanguage.DefaultInputLanguage;
}

but this code will always sets the input language to default when the language input i am setting to is not in the list of installed windows input language.
 
So how can in add a new input language to the windows via code 





我是什么尝试过:





What I have tried:

System.Windows.Forms.InputLanguage original;
private void barButtonItem18_ItemClick_1(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
{
original = System.Windows.Forms.InputLanguage.CurrentInputLanguage;
var culture = System.Globalization.CultureInfo.GetCultureInfo("ar-SA");
var language = System.Windows.Forms.InputLanguage.FromCulture(culture);
if (System.Windows.Forms.InputLanguage.InstalledInputLanguages.IndexOf(language) >= 0)
System.Windows.Forms.InputLanguage.CurrentInputLanguage = language;
else
System.Windows.Forms.InputLanguage.CurrentInputLanguage = System.Windows.Forms.InputLanguage.DefaultInputLanguage;
}

推荐答案

阅读本文:如何在Windows 10上强制删除语言包Windows Central [ ^ ]

和这:从C#执行PowerShell脚本 - Keith Babinec的开发博客 [ ^ ]
Read this : How to force remove a language pack on Windows 10 | Windows Central[^]
and this : Executing PowerShell scripts from C# – Keith Babinec's Development Blog[^]


这篇关于安装/添加新的输入语言到Windows的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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