blah blah blah is here! blah blah » Close

up0down
link

How can i show all the available language of system in a drop down(like in Control Panel->Regional and Language, Regional tab option has a drop down that displays all the language) ?
Thanks.

last answered 8 months ago

1 answers

up0down
link

Try something like:
using System.Globalization;
//...
CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.InstalledWin32Cultures);
string[] languages = new string[cultures.Length];
for (int i = 0; i < cultures.Length; i++)
{
languages[i] = cultures[i].DisplayName;
}
Array.Sort(languages);
CultureInfo currentCulture = CultureInfo.CurrentCulture;
string currentLanguage = currentCulture.DisplayName;
int index = Array.IndexOf(languages, currentLanguage);
comboBox1.DataSource = languages;
comboBox1.SelectedIndex = index;

This post was imported from csharpfriends, if you have a similiar question please ask it again.

All previous members have been migrated, hope you enjoy the new platform!

Feedback