Returns the locale of the current input language.
[Visual Basic] Overridable Public Function GetCulture() As CultureInfo [C#] public virtual CultureInfo GetCulture(); [C++] public: virtual CultureInfo* GetCulture(); [JScript] public function GetCulture() : CultureInfo;
A CultureInfo that represents the locale of the current input language.
The following example gets the locale associated with the current input language and displays the culture name.
First, GetCurrentInputLanguage is called to get the current input language. Then GetCulture is called to get the locale information for this input language. Then EnglishName is retrieved and displayed in a text box.
This code assumes Button1 and TextBox1 have been instantiated.
[C#]
public void MyCulture() { //Get the current input language. InputLanguage myCurrentLanguage = InputLanguage.GetCurrentInputLanguage(); //Get the culture information for the language and print it. CultureInfo myCultureInfo = myCurrentLanguage.GetCulture(); textBox1.Text = myCultureInfo.EnglishName; }
InputLanguage Class | InputLanguage Members | System.WinForms Namespace | GetCurrentInputLanguage