这是在列表框中的数据,从数据库我需要一个组合框的选择项添加到选定项目结束在列表框中
Johnie Black
Sarah Smith
Carol Willis
Maggie Dubois
这是在组合中的数据专栏
(M)
(F)
我要选择列表框中的名称,然后,当我继续从下拉框中选择性别我选择必须添加到所选
例如名称末尾的值。
卡罗尔·威利斯(F)
这是我曾尝试:
private void Form1_Load(object sender, EventArgs e) { this.namesTableAdapter.Fill(this.namesDataSet.names);
comboBox1.Items.Add("(M)");
comboBox1.Items.Add("(F)");
comboBox1.SelectedIndex = 0;
listBox1.SelectedIndex = 0;
}
//The code above loads the items into the comboBox
//For the lisbox I connected to the database using the option "Use Data Bound Items"
任何形式的帮助将不胜感激
好的,那么你有什么尝试? – BugFinder
我试过comboBox.SelectedValue = listBox1.SelectedValue – Destiny
我也试过使用SelectedIndexChanged事件,但没有任何工作 – Destiny