用C#调用智能ABC输入法

2010-08-28 10:49:27来源:西部e网作者:

InputLanguage il = GetDesiredInputLanguage("智能 ABC");
if (il == null)
{
    InputLanguage.CurrentInputLanguage = InputLanguage.DefaultInputLanguage;
    MessageBox.Show("未能找到");
}
textBox1.Focus();
InputLanguage.CurrentInputLanguage = il;
....
public static InputLanguage GetDesiredInputLanguage(string layoutName)
{
    InputLanguageCollection ilc = InputLanguage.InstalledInputLanguages;

    foreach (InputLanguage il in ilc)
    {
        if (il.LayoutName.IndexOf(layoutName) != -1)
            return il;
    }
    return null;
}

关键词:C#

赞助商链接: