InputLanguage.Culture 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取当前输入语言的区域性。
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