我在WinForm的工作,我尝试了很多次赶上下拉框中选定项的文本,我不能,它总是空的,这是代码ComboBox中选定的文本或项目
List<person>op = new List<person>(); op=DAL_O.per();
foreach(person rt in op)
{
comboBox1.DataSource = op;
comboBox1.DisplayMember = "Name_person";
comboBox1.ValueMember = "id_person";
}
}
private void button2_Click(object sender, EventArgs e)
{
Lbl_full_list.Text+=comboBox1.Items[comboBox1.SelectedIndex].ToString();
//or
Lbl_full_list.Text+= comboBox1.Text;
}
也许有人有一个想法?我在Google上搜索了很多并且结果不起作用
感谢该列表 –