用C#調(diào)用智能ABC輸入法

2010-08-28 10:49:27來(lái)源:西部e網(wǎng)作者:

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;
}

關(guān)鍵詞:C#

贊助商鏈接: