111,126
社区成员
发帖
与我相关
我的任务
分享
a = comboBox1.SelectedIndex; //获取选中项索引
int a; //用字段a来保存索引位置
private void 查询_Click(object sender, EventArgs e)
{
a = comboBox1.SelectedText; //获取选中项索引
}
private void 删除_Click(object sender, EventArgs e)
{
comboBox1.Items.RemoveAt(a); //移除
}
private void button1_Click(object sender, EventArgs e)
{
int a = comboBox1.SelectedIndex; //获取选中项索引
comboBox1.Items.RemoveAt(a); //移除
}