private void cbxEstado_SelectionChangeCommitted(object sender, EventArgs e) { try { cbxMunicipio.DataSource = personalcontroller.comboBoxMunicipios(Convert.ToInt64(cbxEstado.SelectedValue.ToString())); cbxMunicipio.DisplayMember = "mun_nombremunicipio"; cbxMunicipio.ValueMember = "mun_id"; cbxMunicipio.SelectedIndex = -1; if (cbxMunicipio.Items.Count == 0) { cbxMunicipio.Enabled = false; } else { cbxMunicipio.Enabled = true; } } catch (Exception ex) { MessageBox.Show("Error: " + ex, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error); } }