共用方式為


InputLanguage.Culture 屬性

定義

取得目前輸入語言的文化特性 (Culture)。

public:
 property System::Globalization::CultureInfo ^ Culture { System::Globalization::CultureInfo ^ get(); };
public System.Globalization.CultureInfo Culture { get; }
member this.Culture : System.Globalization.CultureInfo
Public ReadOnly Property Culture As CultureInfo

屬性值

CultureInfo,表示目前輸入語言的文化特性。

範例

下列程式碼範例會取得 InputLanguage 目前輸入語言的 。 文字方塊會顯示此輸入語言和輸入語言的名稱。

此程式碼假設 textBox1 已具現化。

public:
   void MyCulture()
   {
      // Gets the current input language.
      InputLanguage^ myCurrentLanguage = InputLanguage::CurrentInputLanguage;
      
      // Gets the culture for the language  and prints it.
      CultureInfo^ myCultureInfo = myCurrentLanguage->Culture;
      textBox1->Text = myCultureInfo->EnglishName;
   }
public void MyCulture() {
   // Gets the current input language.
   InputLanguage myCurrentLanguage = InputLanguage.CurrentInputLanguage;

   // Gets the culture for the language  and prints it.
   CultureInfo myCultureInfo = myCurrentLanguage.Culture;
   textBox1.Text = myCultureInfo.EnglishName;
}
Public Sub MyCulture()
   ' Gets the current input language.
   Dim myCurrentLanguage As InputLanguage = InputLanguage.CurrentInputLanguage
       
   ' Gets the culture for the language  and prints it.
   Dim myCultureInfo As CultureInfo = myCurrentLanguage.Culture
   textBox1.Text = myCultureInfo.EnglishName
End Sub

適用於

另請參閱