InputLanguage.Culture Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the culture of the current input language.
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
Property Value
A CultureInfo that represents the culture of the current input language.
Examples
The following code example gets the InputLanguage for the current input language. A text box displays this input language and the name of the input language.
This code assumes that textBox1
has been instantiated.
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
Applies to
See also
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈