コード例 #1
0
        private void PopulateCountryComboBox()
        {
            UnsubscribeToStateChanged();

            countryNames = countryNames ?? ZoneGenerator.GenerateCountryIDs();
            if (cboCountry.Items.Count == 0)
            {
                cboCountry.DataSource = countryNames;
            }

            SubscribeToStateChanged();
        }
コード例 #2
0
        private void SelectCountry()
        {
            countryNames = countryNames ?? ZoneGenerator.GenerateCountryIDs();

            if (cboCountry.Items.Count == 0)
            {
                cboCountry.DataSource = countryNames;
            }

            var index = countryNames.FindIndex(c => c.Contains(address.Data.Country));

            if (index != -1)
            {
                cboCountry.SelectedIndex = index;
            }
            else
            {
                cboCountry.Text = address.Data.Country;
            }
        }