I cannot use GetCultures, from what I can tell it returns a blank list.
private void AddressChooser_Load(object sender, EventArgs e)
{
MessageBox.Show("Form load event successfully triggered") //Debug message - This appears at runtime
foreach (string country in GetCountryList())
{
MessageBox.Show(country); //Debug message - This does not appear at runtime!!
countryBox.Items.Clear();
countryBox.Items.Add(country);
}
}
public static List<string> GetCountryList()
{
MessageBox.Show("Function has been triggered successfully"); //Debug message - This appears at runtime
List<string> cultureList = new List<string>();
CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.AllCultures & ~CultureTypes.NeutralCultures);
foreach (CultureInfo culture in cultures)
{
RegionInfo region = new RegionInfo(culture.LCID);
if (!(cultureList.Contains(region.EnglishName)))
cultureList.Add(region.EnglishName);
MessageBox.Show(region.EnglishName); //Debug message - This does not appear at runtime!
}
return cultureList;
}
I find it strange that this doesn't work considering it is simply a copy&pasted snippet. Please help! Thanks