private void button2_Click(object sender, EventArgs e) { using (var selectForm = new MyCsla.Windows.ListSelectForm()) { selectForm.SourceList = CountryCodesNameValueList.GetNameValueList().ToArray(); selectForm.ListLabel = "Select country"; var result = selectForm.ShowDialog(this); if (result == DialogResult.OK) { countryCodeTextBox.Text = (string)selectForm.SelectedKey; } } }
private void button2_Click(object sender, EventArgs e) { using (var selectForm = new MyCsla.Windows.ListSelectForm()) { selectForm.SourceList = CountryCodesNameValueList.GetNameValueList().ToArray(); selectForm.ListLabel = "Select country"; var result = selectForm.ShowDialog(this); if (result == DialogResult.OK) { countryCodeTextBox.Text = (string) selectForm.SelectedKey; } } }