InputLanguage.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

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

适用于

另请参阅