怎样才能通过编程枚举到当前所有可以使用的输入法,及怎样设置当前输入法

解决方案 »

  1.   

    InputLanguageCollection  ilc  =  InputLanguage.InstalledInputLanguages;    
     
    int intX;
    int intY;
    intX = 10;
    intY = 20;
    int i = 0; foreach  (InputLanguage  il  in  ilc)  
      {  
       //comboBox1.Items.Add(  il.LayoutName  );   
    if(intX + 250 >= this.gpbHavedInput.Width)
    {
    intX = 10;
    intY = intY + 20;
    }
    System.Windows.Forms.CheckBox chbTemp = new CheckBox();
    chbTemp.Name = i.ToString();
    chbTemp.Text = il.LayoutName;
    chbTemp.Location = new System.Drawing.Point(intX, intY);
    chbTemp.Width = 250;
    chbTemp.Cursor = System.Windows.Forms.Cursors.Hand;
    //chbTemp.CheckedChanged += new System.EventHandler(this.CheckedChanged); intX = intX + chbTemp.Width;
    this.gpbHavedInput.Controls.Add(chbTemp);
    i = i + 1;
      }