共用方式為


InputLanguage.InstalledInputLanguages 屬性

定義

取得所有已安裝的輸入語言清單。

public:
 static property System::Windows::Forms::InputLanguageCollection ^ InstalledInputLanguages { System::Windows::Forms::InputLanguageCollection ^ get(); };
public static System.Windows.Forms.InputLanguageCollection InstalledInputLanguages { get; }
static member InstalledInputLanguages : System.Windows.Forms.InputLanguageCollection
Public Shared ReadOnly Property InstalledInputLanguages As 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

適用於

另請參閱