InputLanguage.InstalledInputLanguages 属性

定义

获取所有已安装输入语言的列表。

public:
 static property System::Windows::Forms::InputLanguageCollection ^ InstalledInputLanguages { System::Windows::Forms::InputLanguageCollection ^ get(); };
public static System.Windows.Forms.InputLanguageCollection InstalledInputLanguages { get; }
member this.InstalledInputLanguages : System.Windows.Forms.InputLanguageCollection
Public Shared ReadOnly Property InstalledInputLanguages As InputLanguageCollection

属性值

InputLanguageCollection

InputLanguage 对象的数组,这些对象表示计算机上安装的输入语言。

示例

下面的代码示例检索计算机上安装的所有输入语言并显示其名称。 代码调用 InstalledInputLanguages 以获取已安装的语言。 文本框显示语言名称列表。

此代码假定 textBox1 已实例化且 textBox1.MultiLine 已设置为 true

public:
   void GetLanguages()
   {
      // Gets the list of installed languages.
      for each ( InputLanguage^ lang in InputLanguage::InstalledInputLanguages )
      {
         textBox1->Text = String::Concat( textBox1->Text, lang->Culture->EnglishName, "\n" );
      }
   }
public void GetLanguages() {
   // Gets the list of installed languages.
   foreach(InputLanguage lang in InputLanguage.InstalledInputLanguages) {
      textBox1.Text += lang.Culture.EnglishName + '\n';
   }
}
Public Sub GetLanguages()
   ' Gets the list of installed languages.
   Dim lang As InputLanguage
   For Each lang In  InputLanguage.InstalledInputLanguages
      textBox1.Text &= lang.Culture.EnglishName & ControlChars.Cr
   Next lang
End Sub

适用于

另请参阅