首页 > 开发 > 综合 > 正文

C#调用输入法

2024-07-21 02:26:13
字体:
来源:转载
供稿:网友

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

  private void button1_click(object sender, system.eventargs e) {
   inputlanguage il = getdesiredinputlanguage("智能陈桥输入平台  5.6");
   if (il == null) {
    inputlanguage.currentinputlanguage = inputlanguage.defaultinputlanguage;
    messagebox.show("未能找到");
   }
   textbox1.focus();
   inputlanguage.currentinputlanguage = il;
  }

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表